diff mbox series

[-next] input/rmi4: simplify the return expression of rmi_driver_of_probe()

Message ID 20201210140024.1665-1-zhengyongjun3@huawei.com
State New
Headers show
Series [-next] input/rmi4: simplify the return expression of rmi_driver_of_probe() | expand

Commit Message

Zheng Yongjun Dec. 10, 2020, 2 p.m. UTC
Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/input/rmi4/rmi_driver.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Dmitry Torokhov Dec. 11, 2020, 6:38 a.m. UTC | #1
On Thu, Dec 10, 2020 at 10:00:24PM +0800, Zheng Yongjun wrote:
> Simplify the return expression.

> 

> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>

> ---

>  drivers/input/rmi4/rmi_driver.c | 8 +-------

>  1 file changed, 1 insertion(+), 7 deletions(-)

> 

> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c

> index 258d5fe3d395..eec5d926da25 100644

> --- a/drivers/input/rmi4/rmi_driver.c

> +++ b/drivers/input/rmi4/rmi_driver.c

> @@ -991,14 +991,8 @@ static int rmi_driver_remove(struct device *dev)

>  static int rmi_driver_of_probe(struct device *dev,

>  				struct rmi_device_platform_data *pdata)

>  {

> -	int retval;

> -

> -	retval = rmi_of_property_read_u32(dev, &pdata->reset_delay_ms,

> +	return rmi_of_property_read_u32(dev, &pdata->reset_delay_ms,

>  					"syna,reset-delay-ms", 1);

> -	if (retval)

> -		return retval;

> -

> -	return 0;


The idea of this function is to potentially handle several device
properties, so I would prefer leaving it as is.

Thanks.

-- 
Dmitry
diff mbox series

Patch

diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 258d5fe3d395..eec5d926da25 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -991,14 +991,8 @@  static int rmi_driver_remove(struct device *dev)
 static int rmi_driver_of_probe(struct device *dev,
 				struct rmi_device_platform_data *pdata)
 {
-	int retval;
-
-	retval = rmi_of_property_read_u32(dev, &pdata->reset_delay_ms,
+	return rmi_of_property_read_u32(dev, &pdata->reset_delay_ms,
 					"syna,reset-delay-ms", 1);
-	if (retval)
-		return retval;
-
-	return 0;
 }
 #else
 static inline int rmi_driver_of_probe(struct device *dev,