提交 0dc11e3a 编写于 作者: K Kent Gibson 提交者: Bartosz Golaszewski

gpiolib: cdev: gpio_desc_to_lineinfo() should set info offset

Set the value of the line info offset in gpio_desc_to_lineinfo(), rather
than relying on it being passed in the info.  This makes the function
behave as you would expect from the name - it generates the line info
corresponding to a given GPIO desc.
Signed-off-by: NKent Gibson <warthog618@gmail.com>
Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
上级 42e9acc6
......@@ -752,6 +752,8 @@ static void gpio_desc_to_lineinfo(struct gpio_desc *desc,
bool ok_for_pinctrl;
unsigned long flags;
info->line_offset = gpio_chip_hwgpio(desc);
/*
* This function takes a mutex so we must check this before taking
* the spinlock.
......@@ -933,7 +935,6 @@ static int lineinfo_changed_notify(struct notifier_block *nb,
return NOTIFY_DONE;
memset(&chg, 0, sizeof(chg));
chg.info.line_offset = gpio_chip_hwgpio(desc);
chg.event_type = action;
chg.timestamp = ktime_get_ns();
gpio_desc_to_lineinfo(desc, &chg.info);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册