Thread (19 messages) 19 messages, 2 authors, 2021-03-22

Re: [PATCH v2 8/9] Input: iqs5xx - make reset GPIO optional

From: Jeff LaBundy <hidden>
Date: 2021-03-22 15:43:10
Also in: linux-devicetree

Hi Dmitry,

On Sun, Mar 21, 2021 at 09:06:55PM -0700, Dmitry Torokhov wrote:
Hi Jeff,

On Sat, Mar 13, 2021 at 01:12:35PM -0600, Jeff LaBundy wrote:
quoted
@@ -989,7 +993,11 @@ static int iqs5xx_probe(struct i2c_client *client,
 		return error;
 	}

-	error = devm_device_add_group(&client->dev, &iqs5xx_attr_group);
+	if (iqs5xx->reset_gpio &&
+	    iqs5xx->dev_id_info.bl_status != IQS5XX_BL_STATUS_NONE)
+		attr_group = &iqs5xx_attr_group_bl;
I would prefer if we defined is_visible for the attribute instead of
conditional registration.
Thank you for pointing me to that option; it's much cleaner and I'll
send a v3 with an is_visible callback.
quoted
+
+	error = devm_device_add_group(&client->dev, attr_group);
 	if (error) {
 		dev_err(&client->dev, "Failed to add attributes: %d\n", error);
 		return error;
--
2.17.1
Thanks.

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