Hi Sakari, Thanks for your review > -----Original Message----- > From: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> > Sent: Monday, April 24, 2023 3:25 AM > To: Wu, Wentong <wentong.wu@xxxxxxxxx> > > > + > > +static int mei_ace_setup_dev_link(struct mei_ace *ace) { > > + struct device *dev = &ace->cldev->dev; > > + uuid_le uuid = MEI_CSI_UUID; > > + struct acpi_device *adev; > > + struct device *csi_dev; > > + char name[64]; > > + > > + snprintf(name, sizeof(name), "%s-%pUl", dev_name(dev->parent), > > +&uuid); > > + > > + csi_dev = device_find_child_by_name(dev->parent, name); > > + if (!csi_dev) > > Note that you'll need to put csi_dev if probe fails. Same for driver's remove. Thanks > > > + return -EPROBE_DEFER; > > + > > + /* sensor's ACPI _DEP is mei bus device */ > > + adev = acpi_dev_get_next_consumer_dev(ACPI_COMPANION(dev- > >parent), > > + NULL); > > + if (!adev) > > + return -EPROBE_DEFER; > > Good, the devices can be found here. > > > + > > + /* setup link between mei_ace and mei_csi */ > > + ace->csi_link = device_link_add(csi_dev, dev, DL_FLAG_PM_RUNTIME | > > + DL_FLAG_RPM_ACTIVE); > > + if (!ace->csi_link) { > > + dev_err(dev, "failed to link to %s\n", dev_name(csi_dev)); > > + return -EINVAL; > > + } > > + > > + /* setup link between mei_ace and sensor */ > > + ace->sensor_link = device_link_add(&adev->dev, dev, > DL_FLAG_PM_RUNTIME | > > + DL_FLAG_RPM_ACTIVE); > > + if (!ace->sensor_link) { > > + dev_err(dev, "failed to link to %s\n", dev_name(&adev->dev)); > > Please add error handling --- remove created links if probe fails. ack, thanks > > > + return -EINVAL; > > + } > > + > > + return 0; > > +} > > + > > -- > Regards, > > Sakari Ailus