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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
> > @@ -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.

> 
> > +
> > +	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



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux