diff mbox

[V3,2/3] iio: mxs-lradc: remove mxs_lradc_ts_unregister

Message ID 1461441479-23218-3-git-send-email-stefan.wahren@i2se.com (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Wahren April 23, 2016, 7:57 p.m. UTC
After using devm_input_allocate_device for registration
the function mxs_lradc_ts_unregister isn't necessary anymore
since mxs_lradc_ts_close already does the job.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/iio/adc/mxs-lradc.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Dmitry Torokhov April 25, 2016, 9 p.m. UTC | #1
On Sat, Apr 23, 2016 at 07:57:58PM +0000, Stefan Wahren wrote:
> After using devm_input_allocate_device for registration
> the function mxs_lradc_ts_unregister isn't necessary anymore
> since mxs_lradc_ts_close already does the job.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/iio/adc/mxs-lradc.c |   13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
> index 3d1d370..90242ba 100644
> --- a/drivers/iio/adc/mxs-lradc.c
> +++ b/drivers/iio/adc/mxs-lradc.c
> @@ -1148,14 +1148,6 @@ static int mxs_lradc_ts_register(struct mxs_lradc *lradc)
>  	return input_register_device(input);
>  }
>  
> -static void mxs_lradc_ts_unregister(struct mxs_lradc *lradc)
> -{
> -	if (!lradc->use_touchscreen)
> -		return;
> -
> -	mxs_lradc_disable_ts(lradc);
> -}
> -
>  /*
>   * IRQ Handling
>   */
> @@ -1715,13 +1707,11 @@ static int mxs_lradc_probe(struct platform_device *pdev)
>  	ret = iio_device_register(iio);
>  	if (ret) {
>  		dev_err(dev, "Failed to register IIO device\n");
> -		goto err_ts;
> +		return ret;
>  	}
>  
>  	return 0;
>  
> -err_ts:
> -	mxs_lradc_ts_unregister(lradc);
>  err_ts_register:
>  	mxs_lradc_hw_stop(lradc);
>  err_dev:
> @@ -1739,7 +1729,6 @@ static int mxs_lradc_remove(struct platform_device *pdev)
>  	struct mxs_lradc *lradc = iio_priv(iio);
>  
>  	iio_device_unregister(iio);
> -	mxs_lradc_ts_unregister(lradc);
>  	mxs_lradc_hw_stop(lradc);
>  	mxs_lradc_trigger_remove(iio);
>  	iio_triggered_buffer_cleanup(iio);
> -- 
> 1.7.9.5
>
Jonathan Cameron May 4, 2016, 9:39 a.m. UTC | #2
On 25/04/16 22:00, Dmitry Torokhov wrote:
> On Sat, Apr 23, 2016 at 07:57:58PM +0000, Stefan Wahren wrote:
>> After using devm_input_allocate_device for registration
>> the function mxs_lradc_ts_unregister isn't necessary anymore
>> since mxs_lradc_ts_close already does the job.
>>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Applied.
> 
>> ---
>>  drivers/iio/adc/mxs-lradc.c |   13 +------------
>>  1 file changed, 1 insertion(+), 12 deletions(-)
>>
>> diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
>> index 3d1d370..90242ba 100644
>> --- a/drivers/iio/adc/mxs-lradc.c
>> +++ b/drivers/iio/adc/mxs-lradc.c
>> @@ -1148,14 +1148,6 @@ static int mxs_lradc_ts_register(struct mxs_lradc *lradc)
>>  	return input_register_device(input);
>>  }
>>  
>> -static void mxs_lradc_ts_unregister(struct mxs_lradc *lradc)
>> -{
>> -	if (!lradc->use_touchscreen)
>> -		return;
>> -
>> -	mxs_lradc_disable_ts(lradc);
>> -}
>> -
>>  /*
>>   * IRQ Handling
>>   */
>> @@ -1715,13 +1707,11 @@ static int mxs_lradc_probe(struct platform_device *pdev)
>>  	ret = iio_device_register(iio);
>>  	if (ret) {
>>  		dev_err(dev, "Failed to register IIO device\n");
>> -		goto err_ts;
>> +		return ret;
>>  	}
>>  
>>  	return 0;
>>  
>> -err_ts:
>> -	mxs_lradc_ts_unregister(lradc);
>>  err_ts_register:
>>  	mxs_lradc_hw_stop(lradc);
>>  err_dev:
>> @@ -1739,7 +1729,6 @@ static int mxs_lradc_remove(struct platform_device *pdev)
>>  	struct mxs_lradc *lradc = iio_priv(iio);
>>  
>>  	iio_device_unregister(iio);
>> -	mxs_lradc_ts_unregister(lradc);
>>  	mxs_lradc_hw_stop(lradc);
>>  	mxs_lradc_trigger_remove(iio);
>>  	iio_triggered_buffer_cleanup(iio);
>> -- 
>> 1.7.9.5
>>
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
index 3d1d370..90242ba 100644
--- a/drivers/iio/adc/mxs-lradc.c
+++ b/drivers/iio/adc/mxs-lradc.c
@@ -1148,14 +1148,6 @@  static int mxs_lradc_ts_register(struct mxs_lradc *lradc)
 	return input_register_device(input);
 }
 
-static void mxs_lradc_ts_unregister(struct mxs_lradc *lradc)
-{
-	if (!lradc->use_touchscreen)
-		return;
-
-	mxs_lradc_disable_ts(lradc);
-}
-
 /*
  * IRQ Handling
  */
@@ -1715,13 +1707,11 @@  static int mxs_lradc_probe(struct platform_device *pdev)
 	ret = iio_device_register(iio);
 	if (ret) {
 		dev_err(dev, "Failed to register IIO device\n");
-		goto err_ts;
+		return ret;
 	}
 
 	return 0;
 
-err_ts:
-	mxs_lradc_ts_unregister(lradc);
 err_ts_register:
 	mxs_lradc_hw_stop(lradc);
 err_dev:
@@ -1739,7 +1729,6 @@  static int mxs_lradc_remove(struct platform_device *pdev)
 	struct mxs_lradc *lradc = iio_priv(iio);
 
 	iio_device_unregister(iio);
-	mxs_lradc_ts_unregister(lradc);
 	mxs_lradc_hw_stop(lradc);
 	mxs_lradc_trigger_remove(iio);
 	iio_triggered_buffer_cleanup(iio);