diff mbox series

[-next] HID: intel-ish-hid: simplify the return expression of ishtp_bus_remove_device()

Message ID 20200921131033.92017-1-miaoqinglang@huawei.com (mailing list archive)
State Mainlined
Commit 36725cb091c51104e74d1008097e5d4d10ff372f
Delegated to: Jiri Kosina
Headers show
Series [-next] HID: intel-ish-hid: simplify the return expression of ishtp_bus_remove_device() | expand

Commit Message

Qinglang Miao Sept. 21, 2020, 1:10 p.m. UTC
Simplify the return expression.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 drivers/hid/intel-ish-hid/ishtp/bus.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Pandruvada, Srinivas Sept. 21, 2020, 2:45 p.m. UTC | #1
On Mon, 2020-09-21 at 21:10 +0800, Qinglang Miao wrote:
> Simplify the return expression.
> 
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/hid/intel-ish-hid/ishtp/bus.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c
> b/drivers/hid/intel-ish-hid/ishtp/bus.c
> index c47c3328a..bba29cd36 100644
> --- a/drivers/hid/intel-ish-hid/ishtp/bus.c
> +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
> @@ -502,8 +502,6 @@ static void ishtp_bus_remove_device(struct
> ishtp_cl_device *device)
>  int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
>  			     struct module *owner)
>  {
> -	int err;
> -
>  	if (!ishtp_device_ready)
>  		return -ENODEV;
>  
> @@ -511,11 +509,7 @@ int ishtp_cl_driver_register(struct
> ishtp_cl_driver *driver,
>  	driver->driver.owner = owner;
>  	driver->driver.bus = &ishtp_cl_bus_type;
>  
> -	err = driver_register(&driver->driver);
> -	if (err)
> -		return err;
> -
> -	return 0;
> +	return driver_register(&driver->driver);
>  }
>  EXPORT_SYMBOL(ishtp_cl_driver_register);
>
Jiri Kosina Sept. 22, 2020, 9:10 a.m. UTC | #2
On Mon, 21 Sep 2020, Pandruvada, Srinivas wrote:

> On Mon, 2020-09-21 at 21:10 +0800, Qinglang Miao wrote:
> > Simplify the return expression.
> > 
> > Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index c47c3328a..bba29cd36 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -502,8 +502,6 @@  static void ishtp_bus_remove_device(struct ishtp_cl_device *device)
 int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
 			     struct module *owner)
 {
-	int err;
-
 	if (!ishtp_device_ready)
 		return -ENODEV;
 
@@ -511,11 +509,7 @@  int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
 	driver->driver.owner = owner;
 	driver->driver.bus = &ishtp_cl_bus_type;
 
-	err = driver_register(&driver->driver);
-	if (err)
-		return err;
-
-	return 0;
+	return driver_register(&driver->driver);
 }
 EXPORT_SYMBOL(ishtp_cl_driver_register);