Skip to content

Commit 268793c

Browse files
committed
gpio/aspeed: Don't set names for aspeed GPIOs
We need the numbers for exporting anyway. Signed-off-by: Jeremy Kerr <[email protected]>
1 parent 1549a79 commit 268793c

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

drivers/gpio/gpio-aspeed.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -332,35 +332,6 @@ static struct irq_chip aspeed_gpio_irqchip = {
332332
.irq_set_type = aspeed_gpio_set_type,
333333
};
334334

335-
static void aspeed_gpio_set_names(struct aspeed_gpio *gpio)
336-
{
337-
const char format[] = "GPIOXn";
338-
char *namebuf, **names;
339-
unsigned int i;
340-
341-
/* our buffer of name pointers */
342-
names = devm_kmalloc_array(gpio->chip.dev, gpio->chip.ngpio,
343-
sizeof(char *), GFP_KERNEL);
344-
345-
/* and one contiguous buffer for the names themselves */
346-
namebuf = devm_kmalloc_array(gpio->chip.dev, gpio->chip.ngpio,
347-
sizeof(format), GFP_KERNEL);
348-
349-
for (i = 0; i < gpio->chip.ngpio; i++) {
350-
struct aspeed_gpio_bank *bank = to_bank(i);
351-
char *name = namebuf + (i * sizeof(format));
352-
int bit = GPIO_OFFSET(i);
353-
354-
memcpy(name, format, 4);
355-
name[4] = bank->names[bit >> 3];
356-
name[5] = '0' + (bit % 8);
357-
name[6] = '\0';
358-
names[i] = name;
359-
}
360-
361-
gpio->chip.names = (const char * const *)names;
362-
}
363-
364335
static int aspeed_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
365336
{
366337
struct aspeed_gpio *gpio = to_aspeed_gpio(chip);
@@ -427,8 +398,6 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
427398
gpio->chip.label = dev_name(&pdev->dev);
428399
gpio->chip.base = -1;
429400

430-
aspeed_gpio_set_names(gpio);
431-
432401
platform_set_drvdata(pdev, gpio);
433402

434403
rc = gpiochip_add(&gpio->chip);

0 commit comments

Comments
 (0)