@@ -433,21 +433,14 @@ static int gpio_mockup_probe(struct platform_device *pdev)
if (rv)
return rv;
- rv = device_property_read_string(dev, "chip-name", &name);
+ rv = device_property_read_string(dev, "chip-label", &name);
if (rv)
- name = NULL;
+ name = dev_name(dev);
chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
- if (!name) {
- name = devm_kasprintf(dev, GFP_KERNEL,
- "%s-%c", pdev->name, pdev->id + 'A');
- if (!name)
- return -ENOMEM;
- }
-
mutex_init(&chip->lock);
gc = &chip->gc;
@@ -534,6 +527,7 @@ static void gpio_mockup_unregister_devices(void)
static int __init gpio_mockup_init(void)
{
struct property_entry properties[GPIO_MOCKUP_MAX_PROP];
+ char chip_label[GPIO_MOCKUP_LABEL_SIZE];
struct gpio_mockup_device *mockup_dev;
int i, prop, num_chips, err = 0, base;
struct platform_device_info pdevinfo;
@@ -570,6 +564,11 @@ static int __init gpio_mockup_init(void)
memset(&pdevinfo, 0, sizeof(pdevinfo));
prop = 0;
+ snprintf(chip_label, sizeof(chip_label),
+ "gpio-mockup-%c", i + 'A');
+ properties[prop++] = PROPERTY_ENTRY_STRING("chip-label",
+ chip_label);
+
base = gpio_mockup_range_base(i);
if (base >= 0)
properties[prop++] = PROPERTY_ENTRY_U32("gpio-base",