Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpio/aspeed: Don't set names for aspeed GPIOs #9

Merged
merged 1 commit into from
Oct 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions drivers/gpio/gpio-aspeed.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,35 +332,6 @@ static struct irq_chip aspeed_gpio_irqchip = {
.irq_set_type = aspeed_gpio_set_type,
};

static void aspeed_gpio_set_names(struct aspeed_gpio *gpio)
{
const char format[] = "GPIOXn";
char *namebuf, **names;
unsigned int i;

/* our buffer of name pointers */
names = devm_kmalloc_array(gpio->chip.dev, gpio->chip.ngpio,
sizeof(char *), GFP_KERNEL);

/* and one contiguous buffer for the names themselves */
namebuf = devm_kmalloc_array(gpio->chip.dev, gpio->chip.ngpio,
sizeof(format), GFP_KERNEL);

for (i = 0; i < gpio->chip.ngpio; i++) {
struct aspeed_gpio_bank *bank = to_bank(i);
char *name = namebuf + (i * sizeof(format));
int bit = GPIO_OFFSET(i);

memcpy(name, format, 4);
name[4] = bank->names[bit >> 3];
name[5] = '0' + (bit % 8);
name[6] = '\0';
names[i] = name;
}

gpio->chip.names = (const char * const *)names;
}

static int aspeed_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
struct aspeed_gpio *gpio = to_aspeed_gpio(chip);
Expand Down Expand Up @@ -427,8 +398,6 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
gpio->chip.label = dev_name(&pdev->dev);
gpio->chip.base = -1;

aspeed_gpio_set_names(gpio);

platform_set_drvdata(pdev, gpio);

rc = gpiochip_add(&gpio->chip);
Expand Down