* [PATCH -next] input/rmi4: simplify the return expression of rmi_driver_of_probe()
@ 2020-12-10 14:00 Zheng Yongjun
2020-12-11 6:38 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-10 14:00 UTC (permalink / raw)
To: dmitry.torokhov, linux-input, linux-kernel; +Cc: Zheng Yongjun
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;
}
#else
static inline int rmi_driver_of_probe(struct device *dev,
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] input/rmi4: simplify the return expression of rmi_driver_of_probe()
2020-12-10 14:00 [PATCH -next] input/rmi4: simplify the return expression of rmi_driver_of_probe() Zheng Yongjun
@ 2020-12-11 6:38 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2020-12-11 6:38 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: linux-input, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-11 6:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-10 14:00 [PATCH -next] input/rmi4: simplify the return expression of rmi_driver_of_probe() Zheng Yongjun
2020-12-11 6:38 ` Dmitry Torokhov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.