[PATCH 2/3] i2c: amd-isp: Initialize unique adpater name

Pratap Nirujogi posted 3 patches 6 months, 2 weeks ago
There is a newer version of this series
[PATCH 2/3] i2c: amd-isp: Initialize unique adpater name
Posted by Pratap Nirujogi 6 months, 2 weeks ago
Initialize unique name for amdisp i2c adapter, which is used
in the platform driver to detect the matching adapter for
i2c_client creation.

Fixes: 90b85567e457 ("platform/x86: Add AMD ISP platform config for OV05C10")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/all/04577a46-9add-420c-b181-29bad582026d@infradead.org
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
---
 drivers/i2c/busses/i2c-designware-amdisp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-designware-amdisp.c b/drivers/i2c/busses/i2c-designware-amdisp.c
index ad6f08338124..e8cb3785c740 100644
--- a/drivers/i2c/busses/i2c-designware-amdisp.c
+++ b/drivers/i2c/busses/i2c-designware-amdisp.c
@@ -62,6 +62,8 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
 
 	adap = &isp_i2c_dev->adapter;
 	adap->owner = THIS_MODULE;
+	snprintf(adap->name, sizeof(adap->name),
+		 "AMDISP DesignWare I2C adapter");
 	ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
 	adap->dev.of_node = pdev->dev.of_node;
 	/* use dynamically allocated adapter id */
-- 
2.43.0
Re: [PATCH 2/3] i2c: amd-isp: Initialize unique adpater name
Posted by Ilpo Järvinen 6 months, 2 weeks ago
Hi Pratap,

Please send the next version(s) to all relevant people as indicated by 
scripts/get_maintainer.pl.

On Fri, 30 May 2025, Pratap Nirujogi wrote:

> Initialize unique name for amdisp i2c adapter, which is used
> in the platform driver to detect the matching adapter for
> i2c_client creation.
> 
> Fixes: 90b85567e457 ("platform/x86: Add AMD ISP platform config for OV05C10")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Link: https://lore.kernel.org/all/04577a46-9add-420c-b181-29bad582026d@infradead.org
> Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
> ---
>  drivers/i2c/busses/i2c-designware-amdisp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-amdisp.c b/drivers/i2c/busses/i2c-designware-amdisp.c
> index ad6f08338124..e8cb3785c740 100644
> --- a/drivers/i2c/busses/i2c-designware-amdisp.c
> +++ b/drivers/i2c/busses/i2c-designware-amdisp.c
> @@ -62,6 +62,8 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
>  
>  	adap = &isp_i2c_dev->adapter;
>  	adap->owner = THIS_MODULE;
> +	snprintf(adap->name, sizeof(adap->name),
> +		 "AMDISP DesignWare I2C adapter");

scnprintf() is preferrable over snprintf(). Even if you don't use the 
return value here, eventually somebody will want to get rid of snprintf() 
entirely so lets try not add new ones.

>  	ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
>  	adap->dev.of_node = pdev->dev.of_node;
>  	/* use dynamically allocated adapter id */
> 

-- 
 i.
Re: [PATCH 2/3] i2c: amd-isp: Initialize unique adpater name
Posted by Nirujogi, Pratap 6 months, 2 weeks ago
Hi Ilpo,

Thanks for the review feedback and guidance. Sure, I will take care of 
addressing the review comments and will ensure to include the key 
stakeholders / mailing lists recommened by scripts/get_maintainer.pl 
while submitting the next patch.

Thanks,
Pratap

On 5/31/2025 1:06 AM, Ilpo Järvinen wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> Hi Pratap,
> 
> Please send the next version(s) to all relevant people as indicated by
> scripts/get_maintainer.pl.
> 
> On Fri, 30 May 2025, Pratap Nirujogi wrote:
> 
>> Initialize unique name for amdisp i2c adapter, which is used
>> in the platform driver to detect the matching adapter for
>> i2c_client creation.
>>
>> Fixes: 90b85567e457 ("platform/x86: Add AMD ISP platform config for OV05C10")
>> Reported-by: Randy Dunlap <rdunlap@infradead.org>
>> Link: https://lore.kernel.org/all/04577a46-9add-420c-b181-29bad582026d@infradead.org
>> Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
>> ---
>>   drivers/i2c/busses/i2c-designware-amdisp.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/i2c/busses/i2c-designware-amdisp.c b/drivers/i2c/busses/i2c-designware-amdisp.c
>> index ad6f08338124..e8cb3785c740 100644
>> --- a/drivers/i2c/busses/i2c-designware-amdisp.c
>> +++ b/drivers/i2c/busses/i2c-designware-amdisp.c
>> @@ -62,6 +62,8 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
>>
>>        adap = &isp_i2c_dev->adapter;
>>        adap->owner = THIS_MODULE;
>> +     snprintf(adap->name, sizeof(adap->name),
>> +              "AMDISP DesignWare I2C adapter");
> 
> scnprintf() is preferrable over snprintf(). Even if you don't use the
> return value here, eventually somebody will want to get rid of snprintf()
> entirely so lets try not add new ones.
> 
sure, will use scnprintf() in place of snprintf() in v2.

>>        ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
>>        adap->dev.of_node = pdev->dev.of_node;
>>        /* use dynamically allocated adapter id */
>>
> 
> --
>   i.
>