mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
misc: ad525x_dpot: drop redundant drvdata check
ad525x_group is registered through the I2C and SPI drivers' dev_groups. The driver core creates those groups only after probe succeeds and removes them before invoking the driver's remove callback. ad_dpot_probe() sets the driver data before returning successfully, so ad525x_is_visible() cannot legitimately observe a NULL value. Drop the redundant check instead of silently hiding every attribute if the driver lifecycle invariant is ever broken. Signed-off-by: Jiale Yao <yaojiale02@163.com> Link: https://patch.msgid.link/20260927123507.1219495-1-yaojiale02@163.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f3ada175eb
commit
8c8dcfd43c
|
|
@ -697,9 +697,6 @@ static umode_t ad525x_is_visible(struct kobject *kobj, struct attribute *attr,
|
|||
struct dpot_data *data = dev_get_drvdata(dev);
|
||||
int rdac;
|
||||
|
||||
if (!data)
|
||||
return 0;
|
||||
|
||||
rdac = ad525x_attr_index(attr, dpot_attrib_wipers);
|
||||
if (rdac >= 0)
|
||||
return data->wipers & BIT(rdac) ? attr->mode : 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user