diff mbox series

i2c: core: do not use logical device when creating irq domain

Message ID 20200701082318.11174-1-wsa+renesas@sang-engineering.com
State Accepted
Headers show
Series i2c: core: do not use logical device when creating irq domain | expand

Commit Message

Wolfram Sang July 1, 2020, 8:23 a.m. UTC
Let's rather use its physical parent device to give proper namings and
connections in debugfs.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

This turns the name from "unknown-1" to ":soc:i2c@e6540000" in debugfs
for my use case.

@Benjamin: I am not aware of any other side effects or regression
possibilites. Do you see any?

 drivers/i2c/i2c-core-base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wolfram Sang July 24, 2020, 7:47 p.m. UTC | #1
On Wed, Jul 01, 2020 at 10:23:18AM +0200, Wolfram Sang wrote:
> Let's rather use its physical parent device to give proper namings and
> connections in debugfs.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> This turns the name from "unknown-1" to ":soc:i2c@e6540000" in debugfs
> for my use case.
> 
> @Benjamin: I am not aware of any other side effects or regression
> possibilites. Do you see any?

Last call for opinions before I apply it ;)

> 
>  drivers/i2c/i2c-core-base.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
> index dc43242a85ba..69217d2193da 100644
> --- a/drivers/i2c/i2c-core-base.c
> +++ b/drivers/i2c/i2c-core-base.c
> @@ -1227,7 +1227,7 @@ static int i2c_setup_host_notify_irq_domain(struct i2c_adapter *adap)
>  	if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_HOST_NOTIFY))
>  		return 0;
>  
> -	domain = irq_domain_create_linear(adap->dev.fwnode,
> +	domain = irq_domain_create_linear(adap->dev.parent->fwnode,
>  					  I2C_ADDR_7BITS_COUNT,
>  					  &i2c_host_notify_irq_ops, adap);
>  	if (!domain)
> -- 
> 2.20.1
>
Benjamin Tissoires July 27, 2020, 10:04 a.m. UTC | #2
On Fri, Jul 24, 2020 at 9:54 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> On Wed, Jul 01, 2020 at 10:23:18AM +0200, Wolfram Sang wrote:
> > Let's rather use its physical parent device to give proper namings and
> > connections in debugfs.
> >
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > ---
> >
> > This turns the name from "unknown-1" to ":soc:i2c@e6540000" in debugfs
> > for my use case.
> >
> > @Benjamin: I am not aware of any other side effects or regression
> > possibilites. Do you see any?
>
> Last call for opinions before I apply it ;)

Sorry for the late reply.

AFAICT, there should not be any side effects. This is internal API and
I don't think the callers need to walk through the tree anywhere. So
if that gives a vetter debugfs, why not.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

>
> >
> >  drivers/i2c/i2c-core-base.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
> > index dc43242a85ba..69217d2193da 100644
> > --- a/drivers/i2c/i2c-core-base.c
> > +++ b/drivers/i2c/i2c-core-base.c
> > @@ -1227,7 +1227,7 @@ static int i2c_setup_host_notify_irq_domain(struct i2c_adapter *adap)
> >       if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_HOST_NOTIFY))
> >               return 0;
> >
> > -     domain = irq_domain_create_linear(adap->dev.fwnode,
> > +     domain = irq_domain_create_linear(adap->dev.parent->fwnode,
> >                                         I2C_ADDR_7BITS_COUNT,
> >                                         &i2c_host_notify_irq_ops, adap);
> >       if (!domain)
> > --
> > 2.20.1
> >
Wolfram Sang July 27, 2020, 8:32 p.m. UTC | #3
On Wed, Jul 01, 2020 at 10:23:18AM +0200, Wolfram Sang wrote:
> Let's rather use its physical parent device to give proper namings and
> connections in debugfs.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied to for-next, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index dc43242a85ba..69217d2193da 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -1227,7 +1227,7 @@  static int i2c_setup_host_notify_irq_domain(struct i2c_adapter *adap)
 	if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_HOST_NOTIFY))
 		return 0;
 
-	domain = irq_domain_create_linear(adap->dev.fwnode,
+	domain = irq_domain_create_linear(adap->dev.parent->fwnode,
 					  I2C_ADDR_7BITS_COUNT,
 					  &i2c_host_notify_irq_ops, adap);
 	if (!domain)