Skip to contentSkip to conversation

w83795.c no longer compiles

lm-sensors David Anderson 3 participants 5 messages Nov 1, 2013 – Nov 3, 2013

lore
Share & tools
lore
#0 lore raw

Just installed the new Ubuntu 13.10. Kernel 3.11.0-12 #19.
I get an error building w83795.c (building a module to read my w83795adg temp sensor) for this kernel.

The source is from
http://khali.linux-fr.org/devel/lm-sensors/drivers/w83795/
and has been working for quite a while ... but not with this new kernel series (it was a 3.8.0 kernel in Ubuntu 13.04 and worked fine there).

The error:
'implicit declaration of function 'SENSORS LIMIT' '
at, for example,

      return SENSORS_LIMIT((val + 50) / 100, 0, 0xff);

Thanks in advance for any suggestions.

David Anderson

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#1 lore raw
Quoted 9 lines · David Anderson

Just installed the new Ubuntu 13.10. Kernel 3.11.0-12 #19.
I get an error building w83795.c (building a module to read my w83795adg temp sensor) for this kernel.

The source is from
http://khali.linux-fr.org/devel/lm-sensors/drivers/w83795/
and has been working for quite a while ... but not with this new kernel series (it was a 3.8.0 kernel in Ubuntu 13.04 and worked fine there).

Quoted 6 lines

The error:
'implicit declaration of function 'SENSORS LIMIT' '
at, for example,

     return SENSORS_LIMIT((val + 50) / 100, 0, 0xff);

SENSORS_LIMIT no longer exists; replace it with clamp_val.

Is the driver in the upstream kernel different to the version above ?

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw
In reply to David Anderson
Quoted 8 lines · Guenter Roeck
Quoted 3 lines · David Anderson

Just installed the new Ubuntu 13.10. Kernel 3.11.0-12 #19.
I get an error building w83795.c (building a module to read my w83795adg temp sensor) for this kernel.

SENSORS_LIMIT no longer exists; replace it with clamp_val.

Is the driver in the upstream kernel different to the version above ?

Yes. Different, I now see.

I picked up
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
and the upstream w83795.c had changes. I built a module on the target machine using
the upstream w83795.c ---- it compiles with no warnings and the new module is working fine in my kernel.

Honestly, it would not have occurred to me look for the latest or try building latest w83795.c !

Many thanks for your help.
David Anderson

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#3 lore raw
In reply to David Anderson

Hi David, Guenter,

Quoted 18 lines · David Anderson
Quoted 7 lines · Guenter Roeck
Quoted 3 lines · David Anderson

Just installed the new Ubuntu 13.10. Kernel 3.11.0-12 #19.
I get an error building w83795.c (building a module to read my w83795adg temp sensor) for this kernel.

SENSORS_LIMIT no longer exists; replace it with clamp_val.

Is the driver in the upstream kernel different to the version above ?

Yes. Different, I now see.

I picked up
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
and the upstream w83795.c had changes. I built a module on the target machine using
the upstream w83795.c ---- it compiles with no warnings and the new module is working fine in my kernel.

Quoted 2 lines

Honestly, it would not have occurred to me look for the latest or try building latest w83795.c !

The drivers in http://khali.linux-fr.org/devel/lm-sensors/drivers/ are all snapshots of the respective upstream driver at some point in time, to which I added some compatibility glue so that it build for a range of older kernels. I update them manually as my time permits and needs arise, which means that they are all lagging behind most of the time, by construct.

For example, "my" w83795 driver is currently based on the upstream driver from kernel 2.6.36.1 (doh, this is so old) with enough compatibility glue to work with kernels down to 2.6.27.

In most cases, this shouldn't be a problem, because if you're running a very recent kernel, you shouldn't need to use a standalone driver in the first place, the upstream driver should work just fine. Which brings a question to David: why are you not just using the driver which comes with your kernel?

In the case of the w83795 driver I admit it is about time to remove all the dust because it's indeed very old...

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#4 lore raw
In reply to David Anderson
Quoted 1 line · Jean Delvare

Hi David, Guenter,

... older part of the conversation deleted.

Quoted 11 lines

The drivers in http://khali.linux-fr.org/devel/lm-sensors/drivers/ are all snapshots of the respective upstream driver at some point in time, to which I added some compatibility glue so that it build for a range of older kernels. I update them manually as my time permits and needs arise, which means that they are all lagging behind most of the time, by construct.

For example, "my" w83795 driver is currently based on the upstream driver from kernel 2.6.36.1 (doh, this is so old) with enough compatibility glue to work with kernels down to 2.6.27.

Quoted 5 lines

In most cases, this shouldn't be a problem, because if you're running a very recent kernel, you shouldn't need to use a standalone driver in the first place, the upstream driver should work just fine. Which brings a question to David: why are you not just using the driver which comes with your kernel?

I should have thought of that earlier.

Quoted 4 lines

In the case of the w83795 driver I admit it is about time to remove all the dust because it's indeed very old...

So lets try it now:

Rebooted and "sensors" did not show the proper details, as usual. I used sensors-detect and the I2C/SMBus Adapter detection found SMBus I801 adapter at 0400 (i2c-0)
which found

    Nuvoton W83795G/ADG

I said yes to adding lines to /etc/modules and ran "service kmod start" as sensors detect started and sensors worked right.

Rebooted again.
And now I get sensors working properly automatically on reboot. Yay!

Thanks again.
David Anderson

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors