diff mbox series

[v1,4/7] hwmon: (it87) Add chip_id in some info message

Message ID 20230126040223.986189-5-frank@crawford.emu.id.au (mailing list archive)
State Superseded
Headers show
Series hwmon: (it87) Complete handling multi-chip configuration | expand

Commit Message

Frank Crawford Jan. 26, 2023, 4:02 a.m. UTC
In cases where there are multiple chips, print out which chip is
referred to, in the informational message.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
---
 drivers/hwmon/it87.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Guenter Roeck Jan. 26, 2023, 1:49 p.m. UTC | #1
On Thu, Jan 26, 2023 at 03:02:20PM +1100, Frank Crawford wrote:
> In cases where there are multiple chips, print out which chip is
> referred to, in the informational message.
> 
> Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
> ---
>  drivers/hwmon/it87.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> index 16394b38dce3..5ca8449887da 100644
> --- a/drivers/hwmon/it87.c
> +++ b/drivers/hwmon/it87.c
> @@ -2505,13 +2505,15 @@ static int __init it87_find(int sioaddr, unsigned short *address,
>  
>  	superio_select(sioaddr, PME);
>  	if (!(superio_inb(sioaddr, IT87_ACT_REG) & 0x01)) {
> -		pr_info("Device not activated, skipping\n");
> +		pr_info("Device (DEVID=0x%x) not activated, skipping\n",
> +			chip_type);

At this point the textual name (it87_devices[sio_data->type].model)
is already known. I would suggest to print that instead.

Thanks,
Guenter

>  		goto exit;
>  	}
>  
>  	*address = superio_inw(sioaddr, IT87_BASE_REG) & ~(IT87_EXTENT - 1);
>  	if (*address == 0) {
> -		pr_info("Base address not set, skipping\n");
> +		pr_info("Base address not set (DEVID=0x%x), skipping\n",
> +			chip_type);
>  		goto exit;
>  	}
>  
> -- 
> 2.39.1
>
Frank Crawford Jan. 26, 2023, 10:54 p.m. UTC | #2
On Thu, 2023-01-26 at 05:49 -0800, Guenter Roeck wrote:
> On Thu, Jan 26, 2023 at 03:02:20PM +1100, Frank Crawford wrote:
> > In cases where there are multiple chips, print out which chip is
> > referred to, in the informational message.
> > 
> > Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
> > ---
> >  drivers/hwmon/it87.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> > index 16394b38dce3..5ca8449887da 100644
> > --- a/drivers/hwmon/it87.c
> > +++ b/drivers/hwmon/it87.c
> > @@ -2505,13 +2505,15 @@ static int __init it87_find(int sioaddr,
> > unsigned short *address,
> >  
> >         superio_select(sioaddr, PME);
> >         if (!(superio_inb(sioaddr, IT87_ACT_REG) & 0x01)) {
> > -               pr_info("Device not activated, skipping\n");
> > +               pr_info("Device (DEVID=0x%x) not activated,
> > skipping\n",
> > +                       chip_type);
> 
> At this point the textual name (it87_devices[sio_data->type].model)
> is already known. I would suggest to print that instead.

You are right.  I'll update it to do so, although I also realised I
need to also print the sioaddr, so I can distinguish the case where
both chips are listed as the same.  This is most common when force_id
has been used.
> 
> Thanks,
> Guenter
> 
> >                 goto exit;
> >         }
> >  
> >         *address = superio_inw(sioaddr, IT87_BASE_REG) &
> > ~(IT87_EXTENT - 1);
> >         if (*address == 0) {
> > -               pr_info("Base address not set, skipping\n");
> > +               pr_info("Base address not set (DEVID=0x%x),
> > skipping\n",
> > +                       chip_type);
> >                 goto exit;
> >         }
> >  
> > -- 
> > 2.39.1
> >
diff mbox series

Patch

diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 16394b38dce3..5ca8449887da 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -2505,13 +2505,15 @@  static int __init it87_find(int sioaddr, unsigned short *address,
 
 	superio_select(sioaddr, PME);
 	if (!(superio_inb(sioaddr, IT87_ACT_REG) & 0x01)) {
-		pr_info("Device not activated, skipping\n");
+		pr_info("Device (DEVID=0x%x) not activated, skipping\n",
+			chip_type);
 		goto exit;
 	}
 
 	*address = superio_inw(sioaddr, IT87_BASE_REG) & ~(IT87_EXTENT - 1);
 	if (*address == 0) {
-		pr_info("Base address not set, skipping\n");
+		pr_info("Base address not set (DEVID=0x%x), skipping\n",
+			chip_type);
 		goto exit;
 	}