Thread (3 messages) 3 messages, 2 authors, 2020-09-16

Re: [RESEND] input: iqs62x-keys: Remove superfluous function parameter

flat view

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2020-09-16 17:26:42

Hi Jeff,

On Wed, Sep 16, 2020 at 12:07:33PM -0500, Jeff LaBundy wrote:
It is not necessary to pass iqs62x_keys to iqs62x_keys_parse_prop,
because it can already be derived from the platform_device cookie.
Yes, it can be derived, but why is better to have it derived rather than
passed in? Is the code smaller this way?
quoted hunk ↗ jump to hunk
Signed-off-by: Jeff LaBundy <redacted>
---
 drivers/input/keyboard/iqs62x-keys.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/input/keyboard/iqs62x-keys.c b/drivers/input/keyboard/iqs62x-keys.c
index 93446b2..e2a2b38 100644
--- a/drivers/input/keyboard/iqs62x-keys.c
+++ b/drivers/input/keyboard/iqs62x-keys.c
@@ -42,9 +42,9 @@ struct iqs62x_keys_private {
 	u8 interval;
 };
 
-static int iqs62x_keys_parse_prop(struct platform_device *pdev,
-				  struct iqs62x_keys_private *iqs62x_keys)
+static int iqs62x_keys_parse_prop(struct platform_device *pdev)
 {
+	struct iqs62x_keys_private *iqs62x_keys = platform_get_drvdata(pdev);
 	struct fwnode_handle *child;
 	unsigned int val;
 	int ret, i;
@@ -258,7 +258,7 @@ static int iqs62x_keys_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, iqs62x_keys);
 
-	ret = iqs62x_keys_parse_prop(pdev, iqs62x_keys);
+	ret = iqs62x_keys_parse_prop(pdev);
 	if (ret)
 		return ret;
 
-- 
2.7.4
Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help