[PATCH] macintosh: don't store i2c_add_driver() return if no further processing done

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Dec 20 14:23:34 EST 2005


On Mon, 2005-12-19 at 22:14 -0500, Arthur Othieno wrote:
> therm_pm72.c and windfarm_lm75_sensor.c both store the return from
> i2c_add_driver() but do no further processing on the result. Simply
> return what i2c_add_driver() did, instead.
> 
> Signed-off-by: Arthur Othieno <a.othieno at bluewin.ch>

Acked-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>

> 
>  drivers/macintosh/therm_pm72.c           |    7 +------
>  drivers/macintosh/windfarm_lm75_sensor.c |    7 +------
>  2 files changed, 2 insertions(+), 12 deletions(-)
> 
> 1066f48b47e6d216b41bc58064b7c791d05f4a44
> diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
> index 3fc8cdd..a112eed 100644
> --- a/drivers/macintosh/therm_pm72.c
> +++ b/drivers/macintosh/therm_pm72.c
> @@ -1988,18 +1988,13 @@ static void fcu_lookup_fans(struct devic
>  
>  static int fcu_of_probe(struct of_device* dev, const struct of_device_id *match)
>  {
> -	int rc;
> -
>  	state = state_detached;
>  
>  	/* Lookup the fans in the device tree */
>  	fcu_lookup_fans(dev->node);
>  
>  	/* Add the driver */
> -	rc = i2c_add_driver(&therm_pm72_driver);
> -	if (rc < 0)
> -		return rc;
> -	return 0;
> +	return i2c_add_driver(&therm_pm72_driver);
>  }
>  
>  static int fcu_of_remove(struct of_device* dev)
> diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c
> index a0a41ad..c62ed68 100644
> --- a/drivers/macintosh/windfarm_lm75_sensor.c
> +++ b/drivers/macintosh/windfarm_lm75_sensor.c
> @@ -240,12 +240,7 @@ static int wf_lm75_detach(struct i2c_cli
>  
>  static int __init wf_lm75_sensor_init(void)
>  {
> -	int rc;
> -
> -	rc = i2c_add_driver(&wf_lm75_driver);
> -	if (rc < 0)
> -		return rc;
> -	return 0;
> +	return i2c_add_driver(&wf_lm75_driver);
>  }
>  
>  static void __exit wf_lm75_sensor_exit(void)




More information about the Linuxppc64-dev mailing list