Skip to content

Commit 407c9eb

Browse files
committed
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>
1 parent 304e6be commit 407c9eb

1 file changed

Lines changed: 0 additions & 34 deletions

File tree

drivers/gpu/drm/imx/ipuv3-crtc.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -411,28 +411,6 @@ static int ipu_crtc_init(struct ipu_crtc *ipu_crtc,
411411
return ret;
412412
}
413413

414-
static struct device_node *ipu_drm_get_port_by_id(struct device_node *parent,
415-
int port_id)
416-
{
417-
struct device_node *port;
418-
int id, ret;
419-
420-
port = of_get_child_by_name(parent, "port");
421-
while (port) {
422-
ret = of_property_read_u32(port, "reg", &id);
423-
if (!ret && id == port_id)
424-
return port;
425-
426-
do {
427-
port = of_get_next_child(parent, port);
428-
if (!port)
429-
return NULL;
430-
} while (of_node_cmp(port->name, "port"));
431-
}
432-
433-
return NULL;
434-
}
435-
436414
static int ipu_drm_bind(struct device *dev, struct device *master, void *data)
437415
{
438416
struct ipu_client_platformdata *pdata = dev->platform_data;
@@ -474,23 +452,11 @@ static const struct component_ops ipu_crtc_ops = {
474452
static int ipu_drm_probe(struct platform_device *pdev)
475453
{
476454
struct device *dev = &pdev->dev;
477-
struct ipu_client_platformdata *pdata = dev->platform_data;
478455
int ret;
479456

480457
if (!dev->platform_data)
481458
return -EINVAL;
482459

483-
if (!dev->of_node) {
484-
/* Associate crtc device with the corresponding DI port node */
485-
dev->of_node = ipu_drm_get_port_by_id(dev->parent->of_node,
486-
pdata->di + 2);
487-
if (!dev->of_node) {
488-
dev_err(dev, "missing port@%d node in %s\n",
489-
pdata->di + 2, dev->parent->of_node->full_name);
490-
return -ENODEV;
491-
}
492-
}
493-
494460
ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
495461
if (ret)
496462
return ret;

0 commit comments

Comments
 (0)