diff mbox series

[3/3] i2c: bcm2835: Add full name of devicetree node to adapter name

Message ID 1566925456-5928-4-git-send-email-wahrenst@gmx.net (mailing list archive)
State New, archived
Headers show
Series i2c: bcm2835: Add bcm2711 support | expand

Commit Message

Stefan Wahren Aug. 27, 2019, 5:04 p.m. UTC
Inspired by Lori Hikichi's patch for iproc, this adds the full name of
the devicetree node to the adapter name. With the introduction of
BCM2711 it's very difficult to distinguish between the multiple instances.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/i2c/busses/i2c-bcm2835.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
2.7.4

Comments

Scott Branden Aug. 27, 2019, 9:10 p.m. UTC | #1
On 2019-08-27 10:04 a.m., Stefan Wahren wrote:
> Inspired by Lori Hikichi's patch for iproc, this adds the full name of
> the devicetree node to the adapter name. With the introduction of
> BCM2711 it's very difficult to distinguish between the multiple instances.
>
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Scott Branden <scott.branden@broadcom.com>
> =2D--
>   drivers/i2c/busses/i2c-bcm2835.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm=
> 2835.c
> index ab5502f..e01b2b5 100644
> =2D-- a/drivers/i2c/busses/i2c-bcm2835.c
> +++ b/drivers/i2c/busses/i2c-bcm2835.c
> @@ -472,7 +472,8 @@ static int bcm2835_i2c_probe(struct platform_device *p=
> dev)
>   	i2c_set_adapdata(adap, i2c_dev);
>   	adap->owner =3D THIS_MODULE;
>   	adap->class =3D I2C_CLASS_DEPRECATED;
> -	strlcpy(adap->name, "bcm2835 I2C adapter", sizeof(adap->name));
> +	snprintf(adap->name, sizeof(adap->name), "bcm2835 (%s)",
> +		 of_node_full_name(pdev->dev.of_node));
>   	adap->algo =3D &bcm2835_i2c_algo;
>   	adap->dev.parent =3D &pdev->dev;
>   	adap->dev.of_node =3D pdev->dev.of_node;
> =2D-
> 2.7.4
>
Wolfram Sang Aug. 29, 2019, 6:52 p.m. UTC | #2
On Tue, Aug 27, 2019 at 07:04:16PM +0200, Stefan Wahren wrote:
> Inspired by Lori Hikichi's patch for iproc, this adds the full name of
> the devicetree node to the adapter name. With the introduction of
> BCM2711 it's very difficult to distinguish between the multiple instances.
> 
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>

Applied to for-next, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
index ab5502f..e01b2b5 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -472,7 +472,8 @@  static int bcm2835_i2c_probe(struct platform_device *pdev)
 	i2c_set_adapdata(adap, i2c_dev);
 	adap->owner = THIS_MODULE;
 	adap->class = I2C_CLASS_DEPRECATED;
-	strlcpy(adap->name, "bcm2835 I2C adapter", sizeof(adap->name));
+	snprintf(adap->name, sizeof(adap->name), "bcm2835 (%s)",
+		 of_node_full_name(pdev->dev.of_node));
 	adap->algo = &bcm2835_i2c_algo;
 	adap->dev.parent = &pdev->dev;
 	adap->dev.of_node = pdev->dev.of_node;