diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index e3eb324..b9ba8ce 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -809,42 +809,43 @@
 			data->labels[attr->index].label);
 }
 
-#define PMBUS_ADD_ATTR(data, _name, _idx, _mode, _type, _show, _set)	\
-do {									\
-	struct sensor_device_attribute *a				\
-	    = &data->_type##s[data->num_##_type##s].attribute;		\
-	BUG_ON(data->num_attributes >= data->max_attributes);		\
-	sysfs_attr_init(&a->dev_attr.attr);				\
-	a->dev_attr.attr.name = _name;					\
-	a->dev_attr.attr.mode = _mode;					\
-	a->dev_attr.show = _show;					\
-	a->dev_attr.store = _set;					\
-	a->index = _idx;						\
-	data->attributes[data->num_attributes] = &a->dev_attr.attr;	\
-	data->num_attributes++;						\
-} while (0)
-
-#define PMBUS_ADD_GET_ATTR(data, _name, _type, _idx)			\
-	PMBUS_ADD_ATTR(data, _name, _idx, S_IRUGO, _type,		\
-		       pmbus_show_##_type,  NULL)
-
-#define PMBUS_ADD_SET_ATTR(data, _name, _type, _idx)			\
-	PMBUS_ADD_ATTR(data, _name, _idx, S_IWUSR | S_IRUGO, _type,	\
-		       pmbus_show_##_type, pmbus_set_##_type)
+static void pmbus_attr_init(struct sensor_device_attribute *a,
+			    const char *name,
+			    umode_t mode,
+			    ssize_t (*show)(struct device *dev,
+					    struct device_attribute *attr,
+					    char *buf),
+			    ssize_t (*store)(struct device *dev,
+					     struct device_attribute *attr,
+					     const char *buf, size_t count),
+			    int idx)
+{
+	sysfs_attr_init(&a->dev_attr.attr);
+	a->dev_attr.attr.name = name;
+	a->dev_attr.attr.mode = mode;
+	a->dev_attr.show = show;
+	a->dev_attr.store = store;
+	a->index = idx;
+}
 
 static void pmbus_add_boolean(struct pmbus_data *data,
 			      const char *name, const char *type, int seq,
 			      int idx)
 {
 	struct pmbus_boolean *boolean;
+	struct sensor_device_attribute *a;
 
-	BUG_ON(data->num_booleans >= data->max_booleans);
+	BUG_ON(data->num_booleans >= data->max_booleans ||
+	       data->num_attributes >= data->max_attributes);
 
 	boolean = &data->booleans[data->num_booleans];
+	a = &boolean->attribute;
 
 	snprintf(boolean->name, sizeof(boolean->name), "%s%d_%s",
 		 name, seq, type);
-	PMBUS_ADD_GET_ATTR(data, boolean->name, boolean, idx);
+	pmbus_attr_init(a, boolean->name, S_IRUGO, pmbus_show_boolean, NULL,
+			idx);
+	data->attributes[data->num_attributes++] = &a->dev_attr.attr;
 	data->num_booleans++;
 }
 
@@ -869,22 +870,25 @@
 			     bool update, bool readonly)
 {
 	struct pmbus_sensor *sensor;
+	struct sensor_device_attribute *a;
 
-	BUG_ON(data->num_sensors >= data->max_sensors);
+	BUG_ON(data->num_sensors >= data->max_sensors ||
+	       data->num_attributes >= data->max_attributes);
 
 	sensor = &data->sensors[data->num_sensors];
+	a = &sensor->attribute;
+
 	snprintf(sensor->name, sizeof(sensor->name), "%s%d_%s",
 		 name, seq, type);
 	sensor->page = page;
 	sensor->reg = reg;
 	sensor->class = class;
 	sensor->update = update;
-	if (readonly)
-		PMBUS_ADD_GET_ATTR(data, sensor->name, sensor,
-				   data->num_sensors);
-	else
-		PMBUS_ADD_SET_ATTR(data, sensor->name, sensor,
-				   data->num_sensors);
+	pmbus_attr_init(a, sensor->name,
+			readonly ? S_IRUGO : S_IRUGO | S_IWUSR,
+			pmbus_show_sensor, pmbus_set_sensor, data->num_sensors);
+
+	data->attributes[data->num_attributes++] = &a->dev_attr.attr;
 	data->num_sensors++;
 }
 
@@ -893,10 +897,14 @@
 			    const char *lstring, int index)
 {
 	struct pmbus_label *label;
+	struct sensor_device_attribute *a;
 
-	BUG_ON(data->num_labels >= data->max_labels);
+	BUG_ON(data->num_labels >= data->max_labels ||
+	       data->num_attributes >= data->max_attributes);
 
 	label = &data->labels[data->num_labels];
+	a = &label->attribute;
+
 	snprintf(label->name, sizeof(label->name), "%s%d_label", name, seq);
 	if (!index)
 		strncpy(label->label, lstring, sizeof(label->label) - 1);
@@ -904,7 +912,9 @@
 		snprintf(label->label, sizeof(label->label), "%s%d", lstring,
 			 index);
 
-	PMBUS_ADD_GET_ATTR(data, label->name, label, data->num_labels);
+	pmbus_attr_init(a, label->name, S_IRUGO, pmbus_show_label, NULL,
+			data->num_labels);
+	data->attributes[data->num_attributes++] = &a->dev_attr.attr;
 	data->num_labels++;
 }
 
