Message ID | 20210624095059.4010157-1-sudeep.holla@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] firmware: arm_scmi: Simplify device probe function on the bus | expand |
Hi, On Thu, Jun 24, 2021 at 10:50:58AM +0100, Sudeep Holla wrote: > When the driver core calls the probe callback it already checked that > the devices match, so there is no need to call the match callback again. > > Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> > --- > drivers/firmware/arm_scmi/bus.c | 5 ----- > 1 file changed, 5 deletions(-) > > Hi Uwe, > > Just remembered the similarity in SCMI when you posted similar patches > for Arm FF-A. Thought I will push this out before I forget. I have put > suggested and reported by you as I don't have upstream commit id to refer > yet. Hope that is fine. > > Regards, > Sudeep > > diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c > index 784cf0027da3..dc113ad37ad9 100644 > --- a/drivers/firmware/arm_scmi/bus.c > +++ b/drivers/firmware/arm_scmi/bus.c > @@ -104,11 +104,6 @@ static int scmi_dev_probe(struct device *dev) > { > struct scmi_driver *scmi_drv = to_scmi_driver(dev->driver); > struct scmi_device *scmi_dev = to_scmi_dev(dev); > - const struct scmi_device_id *id; > - > - id = scmi_dev_match_id(scmi_dev, scmi_drv); > - if (!id) > - return -ENODEV; > > if (!scmi_dev->handle) > return -EPROBE_DEFER; Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Tested-by: Cristian Marussi <cristian.marussi@arm.com> Thanks, Cristian > -- > 2.25.1 >
On Thu, Jun 24, 2021 at 10:50:58AM +0100, Sudeep Holla wrote: > When the driver core calls the probe callback it already checked that > the devices match, so there is no need to call the match callback again. > > Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> > --- > drivers/firmware/arm_scmi/bus.c | 5 ----- > 1 file changed, 5 deletions(-) > > Hi Uwe, > > Just remembered the similarity in SCMI when you posted similar patches > for Arm FF-A. Thought I will push this out before I forget. I have put > suggested and reported by you as I don't have upstream commit id to refer > yet. Hope that is fine. Sure. Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Best regards Uwe
On Thu, 24 Jun 2021 10:50:58 +0100, Sudeep Holla wrote: > When the driver core calls the probe callback it already checked that > the devices match, so there is no need to call the match callback again. Applied to sudeep.holla/linux (for-next/scmi), thanks! [1/2] firmware: arm_scmi: Simplify device probe function on the bus https://git.kernel.org/sudeep.holla/c/113e793d18 [2/2] firmware: arm_scmi: Ensure drivers provide a probe function https://git.kernel.org/sudeep.holla/c/8ecab77009 -- Regards, Sudeep
diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index 784cf0027da3..dc113ad37ad9 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -104,11 +104,6 @@ static int scmi_dev_probe(struct device *dev) { struct scmi_driver *scmi_drv = to_scmi_driver(dev->driver); struct scmi_device *scmi_dev = to_scmi_dev(dev); - const struct scmi_device_id *id; - - id = scmi_dev_match_id(scmi_dev, scmi_drv); - if (!id) - return -ENODEV; if (!scmi_dev->handle) return -EPROBE_DEFER;
When the driver core calls the probe callback it already checked that the devices match, so there is no need to call the match callback again. Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> --- drivers/firmware/arm_scmi/bus.c | 5 ----- 1 file changed, 5 deletions(-) Hi Uwe, Just remembered the similarity in SCMI when you posted similar patches for Arm FF-A. Thought I will push this out before I forget. I have put suggested and reported by you as I don't have upstream commit id to refer yet. Hope that is fine. Regards, Sudeep