Re: [PATCH 3/3] mfd: mc13xxx: Simplify "probe" & "remove"

From: Alexander Shiyan
Date: Mon Dec 16 2013 - 04:08:10 EST


> > This patch simplifies "probe" and "remove" functions by moving
> > some initialization code in the driver core.
> >
> > Signed-off-by: Alexander Shiyan <shc_work@xxxxxxx>
> > ---
> > drivers/mfd/mc13xxx-core.c | 36 +++++++++++++++++-------------------
> > drivers/mfd/mc13xxx-i2c.c | 18 ++++--------------
> > drivers/mfd/mc13xxx-spi.c | 19 ++++++-------------
> > drivers/mfd/mc13xxx.h | 6 ++----
> > 4 files changed, 29 insertions(+), 50 deletions(-)
> >
> > diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
> > index b0c7cb0..06e64b6 100644
> > --- a/drivers/mfd/mc13xxx-core.c
> > +++ b/drivers/mfd/mc13xxx-core.c
>
> <snip>
>
> > - ret = request_threaded_irq(irq, NULL, mc13xxx_irq_thread,
> > + ret = request_threaded_irq(mc13xxx->irq, NULL, mc13xxx_irq_thread,
> > IRQF_ONESHOT | IRQF_TRIGGER_HIGH, "mc13xxx", mc13xxx);
>
> Please use devm_* managed resources, then you can remove the free_irq().

Using devm-* is not possible at this time since we need to avoid interrupts before
removing mc13xxx childs.
This could be converted to use devm-* functions once we migrate to IRQ domains.
I work on this now.

---
N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i