lkml.org 
[lkml]   [2012]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] wm831x: Add and use a wm831x_irq_byname convenience function
Date
On Wed, 17 Oct 2012 11:00:55 -0700, Joe Perches <joe@perches.com> wrote:
> Add and use a convenience inline to get an irq by name.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> Perhaps this is a better alternative to code reflowing.
>
> include/linux/mfd/wm831x/core.h | 8 ++++++++
> drivers/input/touchscreen/wm831x-ts.c | 7 ++-----
> drivers/power/wm831x_power.c | 20 ++++++++------------
> drivers/regulator/wm831x-dcdc.c | 23 +++++++++--------------
> drivers/regulator/wm831x-ldo.c | 10 ++++------
> drivers/rtc/rtc-wm831x.c | 2 +-
> 6 files changed, 32 insertions(+), 38 deletions(-)
>
> diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
> index 4a3b83a..96cd081 100644
> --- a/include/linux/mfd/wm831x/core.h
> +++ b/include/linux/mfd/wm831x/core.h
> @@ -20,6 +20,7 @@
> #include <linux/irqdomain.h>
> #include <linux/list.h>
> #include <linux/regmap.h>
> +#include <linux/platform_device.h>
>
> /*
> * Register values.
> @@ -425,6 +426,13 @@ static inline int wm831x_irq(struct wm831x *wm831x, int irq)
> return irq_create_mapping(wm831x->irq_domain, irq);
> }
>
> +static inline int wm831x_irq_byname(struct wm831x *wm831x,
> + struct platform_device *pdev,
> + const char *name)
> +{
> + return wm831x_irq(wm831x, platform_get_irq_byname(pdev, name));
> +}
> +
> extern struct regmap_config wm831x_regmap_config;

Looks reasonable

g.



\
 
 \ /
  Last update: 2012-11-26 23:21    [W:0.046 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site