All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
@ 2022-07-06 17:21 ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2022-07-06 17:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Florian Fainelli, Kamal Dasu,
	Broadcom internal kernel review list, Wolfram Sang,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE

When the adapter is registered without interrupts, we would be showing
the following:

  # i2cdetect -l
  i2c-3   i2c             Broadcom STB :                          I2C adapter

which is visually disturbing, only add the separator if we do have an
interrupt.

Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/i2c/busses/i2c-brcmstb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index b00f35c0b066..538a51299e04 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -684,9 +684,11 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
 	adap = &dev->adapter;
 	i2c_set_adapdata(adap, dev);
 	adap->owner = THIS_MODULE;
-	strlcpy(adap->name, "Broadcom STB : ", sizeof(adap->name));
-	if (int_name)
+	strlcpy(adap->name, "Broadcom STB", sizeof(adap->name));
+	if (int_name) {
+		strlcat(adap->name, ": ", sizeof(adap->name));
 		strlcat(adap->name, int_name, sizeof(adap->name));
+	}
 	adap->algo = &brcmstb_i2c_algo;
 	adap->dev.parent = &pdev->dev;
 	adap->dev.of_node = pdev->dev.of_node;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
@ 2022-07-06 17:21 ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2022-07-06 17:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Florian Fainelli, Kamal Dasu,
	Broadcom internal kernel review list, Wolfram Sang,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE

When the adapter is registered without interrupts, we would be showing
the following:

  # i2cdetect -l
  i2c-3   i2c             Broadcom STB :                          I2C adapter

which is visually disturbing, only add the separator if we do have an
interrupt.

Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/i2c/busses/i2c-brcmstb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index b00f35c0b066..538a51299e04 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -684,9 +684,11 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
 	adap = &dev->adapter;
 	i2c_set_adapdata(adap, dev);
 	adap->owner = THIS_MODULE;
-	strlcpy(adap->name, "Broadcom STB : ", sizeof(adap->name));
-	if (int_name)
+	strlcpy(adap->name, "Broadcom STB", sizeof(adap->name));
+	if (int_name) {
+		strlcat(adap->name, ": ", sizeof(adap->name));
 		strlcat(adap->name, int_name, sizeof(adap->name));
+	}
 	adap->algo = &brcmstb_i2c_algo;
 	adap->dev.parent = &pdev->dev;
 	adap->dev.of_node = pdev->dev.of_node;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
  2022-07-06 17:21 ` Florian Fainelli
@ 2022-07-16 12:40   ` Wolfram Sang
  -1 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2022-07-16 12:40 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-kernel, Kamal Dasu, Broadcom internal kernel review list,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE

[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]

On Wed, Jul 06, 2022 at 10:21:15AM -0700, Florian Fainelli wrote:
> When the adapter is registered without interrupts, we would be showing
> the following:
> 
>   # i2cdetect -l
>   i2c-3   i2c             Broadcom STB :                          I2C adapter

What about switching to pdev->name here? That way you also get the base
address for free to differentiate if there are multiple instances on the
SoC?

> 
> which is visually disturbing, only add the separator if we do have an
> interrupt.
> 
> Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/i2c/busses/i2c-brcmstb.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> index b00f35c0b066..538a51299e04 100644
> --- a/drivers/i2c/busses/i2c-brcmstb.c
> +++ b/drivers/i2c/busses/i2c-brcmstb.c
> @@ -684,9 +684,11 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
>  	adap = &dev->adapter;
>  	i2c_set_adapdata(adap, dev);
>  	adap->owner = THIS_MODULE;
> -	strlcpy(adap->name, "Broadcom STB : ", sizeof(adap->name));
> -	if (int_name)
> +	strlcpy(adap->name, "Broadcom STB", sizeof(adap->name));
> +	if (int_name) {
> +		strlcat(adap->name, ": ", sizeof(adap->name));
>  		strlcat(adap->name, int_name, sizeof(adap->name));
> +	}
>  	adap->algo = &brcmstb_i2c_algo;
>  	adap->dev.parent = &pdev->dev;
>  	adap->dev.of_node = pdev->dev.of_node;
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
@ 2022-07-16 12:40   ` Wolfram Sang
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2022-07-16 12:40 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-kernel, Kamal Dasu, Broadcom internal kernel review list,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE


[-- Attachment #1.1: Type: text/plain, Size: 1581 bytes --]

On Wed, Jul 06, 2022 at 10:21:15AM -0700, Florian Fainelli wrote:
> When the adapter is registered without interrupts, we would be showing
> the following:
> 
>   # i2cdetect -l
>   i2c-3   i2c             Broadcom STB :                          I2C adapter

What about switching to pdev->name here? That way you also get the base
address for free to differentiate if there are multiple instances on the
SoC?

> 
> which is visually disturbing, only add the separator if we do have an
> interrupt.
> 
> Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/i2c/busses/i2c-brcmstb.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> index b00f35c0b066..538a51299e04 100644
> --- a/drivers/i2c/busses/i2c-brcmstb.c
> +++ b/drivers/i2c/busses/i2c-brcmstb.c
> @@ -684,9 +684,11 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
>  	adap = &dev->adapter;
>  	i2c_set_adapdata(adap, dev);
>  	adap->owner = THIS_MODULE;
> -	strlcpy(adap->name, "Broadcom STB : ", sizeof(adap->name));
> -	if (int_name)
> +	strlcpy(adap->name, "Broadcom STB", sizeof(adap->name));
> +	if (int_name) {
> +		strlcat(adap->name, ": ", sizeof(adap->name));
>  		strlcat(adap->name, int_name, sizeof(adap->name));
> +	}
>  	adap->algo = &brcmstb_i2c_algo;
>  	adap->dev.parent = &pdev->dev;
>  	adap->dev.of_node = pdev->dev.of_node;
> -- 
> 2.25.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
  2022-07-16 12:40   ` Wolfram Sang
@ 2022-07-19  0:15     ` Florian Fainelli
  -1 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2022-07-19  0:15 UTC (permalink / raw)
  To: Wolfram Sang, linux-kernel, Kamal Dasu,
	Broadcom internal kernel review list,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE



On 7/16/2022 5:40 AM, Wolfram Sang wrote:
> On Wed, Jul 06, 2022 at 10:21:15AM -0700, Florian Fainelli wrote:
>> When the adapter is registered without interrupts, we would be showing
>> the following:
>>
>>    # i2cdetect -l
>>    i2c-3   i2c             Broadcom STB :                          I2C adapter
> 
> What about switching to pdev->name here? That way you also get the base
> address for free to differentiate if there are multiple instances on the
> SoC?

I was not sure if we could change the adapter name reported as one could 
argue this is now ABI, but if we can, then using dev_name() is probably 
better. You are the maintainer you so know the rules on what is 
considered stable ABI and what is not :)
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
@ 2022-07-19  0:15     ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2022-07-19  0:15 UTC (permalink / raw)
  To: Wolfram Sang, linux-kernel, Kamal Dasu,
	Broadcom internal kernel review list,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE



On 7/16/2022 5:40 AM, Wolfram Sang wrote:
> On Wed, Jul 06, 2022 at 10:21:15AM -0700, Florian Fainelli wrote:
>> When the adapter is registered without interrupts, we would be showing
>> the following:
>>
>>    # i2cdetect -l
>>    i2c-3   i2c             Broadcom STB :                          I2C adapter
> 
> What about switching to pdev->name here? That way you also get the base
> address for free to differentiate if there are multiple instances on the
> SoC?

I was not sure if we could change the adapter name reported as one could 
argue this is now ABI, but if we can, then using dev_name() is probably 
better. You are the maintainer you so know the rules on what is 
considered stable ABI and what is not :)
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
  2022-07-19  0:15     ` Florian Fainelli
@ 2022-07-19  3:57       ` Wolfram Sang
  -1 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2022-07-19  3:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-kernel, Kamal Dasu, Broadcom internal kernel review list,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]


> I was not sure if we could change the adapter name reported as one could
> argue this is now ABI, but if we can, then using dev_name() is probably
> better. You are the maintainer you so know the rules on what is considered
> stable ABI and what is not :)

Well, then even removing ":" would break the ABI :)

Please use dev_name. Other drivers changed that string, too. We never
gave guarantees for that one.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
@ 2022-07-19  3:57       ` Wolfram Sang
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2022-07-19  3:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-kernel, Kamal Dasu, Broadcom internal kernel review list,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE


[-- Attachment #1.1: Type: text/plain, Size: 414 bytes --]


> I was not sure if we could change the adapter name reported as one could
> argue this is now ABI, but if we can, then using dev_name() is probably
> better. You are the maintainer you so know the rules on what is considered
> stable ABI and what is not :)

Well, then even removing ":" would break the ABI :)

Please use dev_name. Other drivers changed that string, too. We never
gave guarantees for that one.


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
  2022-07-19  3:57       ` Wolfram Sang
@ 2022-07-19  4:06         ` Florian Fainelli
  -1 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2022-07-19  4:06 UTC (permalink / raw)
  To: Wolfram Sang, linux-kernel, Kamal Dasu,
	Broadcom internal kernel review list,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE



On 7/18/2022 8:57 PM, Wolfram Sang wrote:
> 
>> I was not sure if we could change the adapter name reported as one could
>> argue this is now ABI, but if we can, then using dev_name() is probably
>> better. You are the maintainer you so know the rules on what is considered
>> stable ABI and what is not :)
> 
> Well, then even removing ":" would break the ABI :)
> 
> Please use dev_name. Other drivers changed that string, too. We never
> gave guarantees for that one.
> 

Fair enough, sent a v2 using dev_name(), thanks!
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts
@ 2022-07-19  4:06         ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2022-07-19  4:06 UTC (permalink / raw)
  To: Wolfram Sang, linux-kernel, Kamal Dasu,
	Broadcom internal kernel review list,
	open list:BROADCOM BRCMSTB I2C DRIVER,
	moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE



On 7/18/2022 8:57 PM, Wolfram Sang wrote:
> 
>> I was not sure if we could change the adapter name reported as one could
>> argue this is now ABI, but if we can, then using dev_name() is probably
>> better. You are the maintainer you so know the rules on what is considered
>> stable ABI and what is not :)
> 
> Well, then even removing ":" would break the ABI :)
> 
> Please use dev_name. Other drivers changed that string, too. We never
> gave guarantees for that one.
> 

Fair enough, sent a v2 using dev_name(), thanks!
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-07-19  4:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 17:21 [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts Florian Fainelli
2022-07-06 17:21 ` Florian Fainelli
2022-07-16 12:40 ` Wolfram Sang
2022-07-16 12:40   ` Wolfram Sang
2022-07-19  0:15   ` Florian Fainelli
2022-07-19  0:15     ` Florian Fainelli
2022-07-19  3:57     ` Wolfram Sang
2022-07-19  3:57       ` Wolfram Sang
2022-07-19  4:06       ` Florian Fainelli
2022-07-19  4:06         ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.