From 8c8dcfd43c31c1059218e756eb1772fb24cb79f6 Mon Sep 17 00:00:00 2001 From: Jiale Yao Date: Sun, 27 Sep 2026 20:35:06 +0800 Subject: [PATCH] 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 Link: https://patch.msgid.link/20260927123507.1219495-1-yaojiale02@163.com Signed-off-by: Greg Kroah-Hartman --- 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 97f124b1980d..79054250976e 100644 --- a/drivers/misc/ad525x_dpot.c +++ b/drivers/misc/ad525x_dpot.c @@ -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;