gpio: mockup: Switch to use gpiochip_get_desc()

Switch to use gpiochip_get_desc() helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This commit is contained in:
Andy Shevchenko 2021-05-10 22:52:52 +03:00 committed by Bartosz Golaszewski
parent c35fb57665
commit e7d8fde4ab
1 changed files with 3 additions and 6 deletions

View File

@ -144,12 +144,9 @@ static void gpio_mockup_set_multiple(struct gpio_chip *gc,
static int gpio_mockup_apply_pull(struct gpio_mockup_chip *chip, static int gpio_mockup_apply_pull(struct gpio_mockup_chip *chip,
unsigned int offset, int value) unsigned int offset, int value)
{ {
struct gpio_chip *gc = &chip->gc;
struct gpio_desc *desc = gpiochip_get_desc(gc, offset);
int curr, irq, irq_type, ret = 0; int curr, irq, irq_type, ret = 0;
struct gpio_desc *desc;
struct gpio_chip *gc;
gc = &chip->gc;
desc = &gc->gpiodev->descs[offset];
mutex_lock(&chip->lock); mutex_lock(&chip->lock);
@ -369,7 +366,7 @@ static void gpio_mockup_debugfs_setup(struct device *dev,
priv->chip = chip; priv->chip = chip;
priv->offset = i; priv->offset = i;
priv->desc = &gc->gpiodev->descs[i]; priv->desc = gpiochip_get_desc(gc, i);
debugfs_create_file(name, 0200, chip->dbg_dir, priv, debugfs_create_file(name, 0200, chip->dbg_dir, priv,
&gpio_mockup_debugfs_ops); &gpio_mockup_debugfs_ops);