diff options
Diffstat (limited to 'drivers/misc/isl29020.c')
| -rw-r--r-- | drivers/misc/isl29020.c | 26 | 
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/misc/isl29020.c b/drivers/misc/isl29020.c index ca47e628507..4a9c50a43af 100644 --- a/drivers/misc/isl29020.c +++ b/drivers/misc/isl29020.c @@ -23,7 +23,6 @@   */  #include <linux/module.h> -#include <linux/init.h>  #include <linux/slab.h>  #include <linux/i2c.h>  #include <linux/err.h> @@ -90,8 +89,10 @@ static ssize_t als_sensing_range_store(struct device *dev,  	int ret_val;  	unsigned long val; -	if (strict_strtoul(buf, 10, &val)) -		return -EINVAL; +	ret_val = kstrtoul(buf, 10, &val); +	if (ret_val) +		return ret_val; +  	if (val < 1 || val > 64000)  		return -EINVAL; @@ -158,7 +159,7 @@ static int als_set_default_config(struct i2c_client *client)  		dev_err(&client->dev, "default write failed.");  		return retval;  	} -	return 0;; +	return 0;  }  static int  isl29020_probe(struct i2c_client *client, @@ -183,9 +184,7 @@ static int  isl29020_probe(struct i2c_client *client,  static int isl29020_remove(struct i2c_client *client)  { -	struct als_data *data = i2c_get_clientdata(client);  	sysfs_remove_group(&client->dev.kobj, &m_als_gr); -	kfree(data);  	return 0;  } @@ -232,19 +231,8 @@ static struct i2c_driver isl29020_driver = {  	.id_table = isl29020_id,  }; -static int __init sensor_isl29020_init(void) -{ -	return i2c_add_driver(&isl29020_driver); -} - -static void  __exit sensor_isl29020_exit(void) -{ -	i2c_del_driver(&isl29020_driver); -} - -module_init(sensor_isl29020_init); -module_exit(sensor_isl29020_exit); +module_i2c_driver(isl29020_driver); -MODULE_AUTHOR("Kalhan Trisal <kalhan.trisal@intel.com"); +MODULE_AUTHOR("Kalhan Trisal <kalhan.trisal@intel.com>");  MODULE_DESCRIPTION("Intersil isl29020 ALS Driver");  MODULE_LICENSE("GPL v2");  | 
