Message ID | 20240326202813.1425431-3-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers | show |
Series | media: atomisp: Fix and refactor PMIC I��C discovery | expand |
Hi Andy, Thank you for the patch. On 3/26/24 9:27 PM, Andy Shevchenko wrote: > gmin_i2c_dev_exists() is using open-coded variant of > i2c_find_device_by_fwnode(). Replace it with a corresponding call. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c > index 80aa2211cdc3..b7c477280986 100644 > --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c > +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c > @@ -394,12 +394,10 @@ static struct i2c_client *gmin_i2c_dev_exists(struct device *dev, char *name, > if (!adev) > return NULL; > > - d = bus_find_device_by_acpi_dev(&i2c_bus_type, adev); > + d = get_device(acpi_get_first_physical_node(adev)); > acpi_dev_put(adev); > - if (!d) > - return NULL; > > - *client = i2c_verify_client(d); > + *client = i2c_find_device_by_fwnode(dev_fwnode(d)); > put_device(d); > > dev_dbg(dev, "found '%s' at address 0x%02x, adapter %d\n", If we are ging to simplify this I think the change should be:
On Wed, Apr 10, 2024 at 12:35:29PM +0200, Hans de Goede wrote: > On 3/26/24 9:27 PM, Andy Shevchenko wrote: ... > I'm going to merge this variant into my media-atomisp branch > instead of the orignal. Thanks! This explains why changelog made the commit message. Was it done deliberately?
Hi Andy, On 4/10/24 3:35 PM, Andy Shevchenko wrote: > On Wed, Apr 10, 2024 at 12:35:29PM +0200, Hans de Goede wrote: >> On 3/26/24 9:27 PM, Andy Shevchenko wrote: > > ... > >> I'm going to merge this variant into my media-atomisp branch >> instead of the orignal. > > Thanks! > > This explains why changelog made the commit message. > Was it done deliberately? Oops, no that was by accident. I normally git send-email + git am my patches and then git am cuts it off... I just send out a pull-request with this minor wart in it (after testing), so unless there are other reasons to respin I guess we'll have to live with it. Regards, Hans
On Wed, Apr 10, 2024 at 03:41:15PM +0200, Hans de Goede wrote: > On 4/10/24 3:35 PM, Andy Shevchenko wrote: > > On Wed, Apr 10, 2024 at 12:35:29PM +0200, Hans de Goede wrote: > >> On 3/26/24 9:27 PM, Andy Shevchenko wrote: ... > >> I'm going to merge this variant into my media-atomisp branch > >> instead of the orignal. > > > > Thanks! > > > > This explains why changelog made the commit message. > > Was it done deliberately? > > Oops, no that was by accident. I normally git send-email > + git am my patches and then git am cuts it off... > > I just send out a pull-request with this minor wart in it > (after testing), so unless there are other reasons to respin > I guess we'll have to live with it. You might check the linux-next scripts or ask Stephen if this is an issue. In any case we will know sooner or later :-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index 80aa2211cdc3..b7c477280986 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -394,12 +394,10 @@ static struct i2c_client *gmin_i2c_dev_exists(struct device *dev, char *name, if (!adev) return NULL; - d = bus_find_device_by_acpi_dev(&i2c_bus_type, adev); + d = get_device(acpi_get_first_physical_node(adev)); acpi_dev_put(adev); - if (!d) - return NULL; - *client = i2c_verify_client(d); + *client = i2c_find_device_by_fwnode(dev_fwnode(d)); put_device(d); dev_dbg(dev, "found '%s' at address 0x%02x, adapter %d\n",
gmin_i2c_dev_exists() is using open-coded variant of i2c_find_device_by_fwnode(). Replace it with a corresponding call. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)