drm/imx: Remove of_node assignment from ipuv3-crtc driver probe
The crtc child device driver shouldn't modify the of_node of its platform device in the probe function. Instead, since the previous patch, the IPU core driver sets the of_node when the platform device is created. Drop the now unused custom imx_drm_get_port_by_id function. Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
304e6be652
commit
407c9eba78
|
@ -411,28 +411,6 @@ err_put_resources:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct device_node *ipu_drm_get_port_by_id(struct device_node *parent,
|
||||
int port_id)
|
||||
{
|
||||
struct device_node *port;
|
||||
int id, ret;
|
||||
|
||||
port = of_get_child_by_name(parent, "port");
|
||||
while (port) {
|
||||
ret = of_property_read_u32(port, "reg", &id);
|
||||
if (!ret && id == port_id)
|
||||
return port;
|
||||
|
||||
do {
|
||||
port = of_get_next_child(parent, port);
|
||||
if (!port)
|
||||
return NULL;
|
||||
} while (of_node_cmp(port->name, "port"));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int ipu_drm_bind(struct device *dev, struct device *master, void *data)
|
||||
{
|
||||
struct ipu_client_platformdata *pdata = dev->platform_data;
|
||||
|
@ -474,23 +452,11 @@ static const struct component_ops ipu_crtc_ops = {
|
|||
static int ipu_drm_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct ipu_client_platformdata *pdata = dev->platform_data;
|
||||
int ret;
|
||||
|
||||
if (!dev->platform_data)
|
||||
return -EINVAL;
|
||||
|
||||
if (!dev->of_node) {
|
||||
/* Associate crtc device with the corresponding DI port node */
|
||||
dev->of_node = ipu_drm_get_port_by_id(dev->parent->of_node,
|
||||
pdata->di + 2);
|
||||
if (!dev->of_node) {
|
||||
dev_err(dev, "missing port@%d node in %s\n",
|
||||
pdata->di + 2, dev->parent->of_node->full_name);
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue