[PATCH] misc: ad525x_dpot: drop redundant drvdata check
From: Jiale Yao
Date: Sun Sep 27 2026 - 08:35:47 EST
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@xxxxxxx>
---
drivers/misc/ad525x_dpot.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index a4e22fd4a107..28db4d8ee504 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -699,9 +699,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;
--
2.34.1