chelsio: use const for virtual functions
[powerpc.git] / drivers / hwmon / lm78.c
index ac1b746..886786c 100644 (file)
@@ -125,10 +125,8 @@ static inline int TEMP_FROM_REG(s8 val)
    bad. Quite a lot of bookkeeping is done. A real driver can often cut
    some corners. */
 
-/* For each registered LM78, we need to keep some data in memory. That
-   data is pointed to by lm78_list[NR]->data. The structure itself is
-   dynamically allocated, at the same time when a new lm78 client is
-   allocated. */
+/* For each registered chip, we need to keep some data in memory.
+   The structure is dynamically allocated. */
 struct lm78_data {
        struct i2c_client client;
        struct class_device *class_dev;
@@ -815,18 +813,18 @@ static int __init sm_lm78_init(void)
        if (res)
                return res;
 
-       res = i2c_isa_add_driver(&lm78_isa_driver);
-       if (res) {
-               i2c_del_driver(&lm78_driver);
-               return res;
-       }
+       /* Don't exit if this one fails, we still want the I2C variants
+          to work! */
+       if (i2c_isa_add_driver(&lm78_isa_driver))
+               isa_address = 0;
 
        return 0;
 }
 
 static void __exit sm_lm78_exit(void)
 {
-       i2c_isa_del_driver(&lm78_isa_driver);
+       if (isa_address)
+               i2c_isa_del_driver(&lm78_isa_driver);
        i2c_del_driver(&lm78_driver);
 }