mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 00:21:59 +00:00
cxl/core: Use is_endpoint_decoder
Save some characters and directly check decoder type rather than port type. There's no need to check if the port is an endpoint port since, by this point, cxl_endpoint_decoder_alloc() has a specified type. Reviewed by: Adam Manzanares <a.manzanares@samsung.com> Signed-off-by: Ben Widawsky <ben.widawsky@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
db9a3a35d3
commit
8ae3cebc17
@ -197,7 +197,7 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
|
||||
else
|
||||
cxld->target_type = CXL_DECODER_ACCELERATOR;
|
||||
|
||||
if (is_cxl_endpoint(to_cxl_port(cxld->dev.parent)))
|
||||
if (is_endpoint_decoder(&cxld->dev))
|
||||
return 0;
|
||||
|
||||
target_list.value =
|
||||
|
@ -272,7 +272,7 @@ static const struct device_type cxl_decoder_root_type = {
|
||||
.groups = cxl_decoder_root_attribute_groups,
|
||||
};
|
||||
|
||||
static bool is_endpoint_decoder(struct device *dev)
|
||||
bool is_endpoint_decoder(struct device *dev)
|
||||
{
|
||||
return dev->type == &cxl_decoder_endpoint_type;
|
||||
}
|
||||
|
@ -340,6 +340,7 @@ struct cxl_dport *cxl_find_dport_by_dev(struct cxl_port *port,
|
||||
|
||||
struct cxl_decoder *to_cxl_decoder(struct device *dev);
|
||||
bool is_root_decoder(struct device *dev);
|
||||
bool is_endpoint_decoder(struct device *dev);
|
||||
bool is_cxl_decoder(struct device *dev);
|
||||
struct cxl_decoder *cxl_root_decoder_alloc(struct cxl_port *port,
|
||||
unsigned int nr_targets);
|
||||
|
Loading…
Reference in New Issue
Block a user