Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751364AbbEQTAP (ORCPT ); Sun, 17 May 2015 15:00:15 -0400 Received: from down.free-electrons.com ([37.187.137.238]:38253 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750880AbbEQTAH (ORCPT ); Sun, 17 May 2015 15:00:07 -0400 Date: Sun, 17 May 2015 16:19:22 +0200 From: Maxime Ripard To: Jens Kuske Cc: Emilio =?iso-8859-1?Q?L=F3pez?= , Mike Turquette , Linus Walleij , Rob Herring , Chen-Yu Tsai , Vishnu Patekar , Hans de Goede , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 04/10] pinctrl: sunxi: Prepare for building SoC specific drivers as modules Message-ID: <20150517141922.GE4004@lukather> References: <1431707940-19372-1-git-send-email-jenskuske@gmail.com> <1431707940-19372-5-git-send-email-jenskuske@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZvvH1QDaOFG4lOZN" Content-Disposition: inline In-Reply-To: <1431707940-19372-5-git-send-email-jenskuske@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3526 Lines: 108 --ZvvH1QDaOFG4lOZN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 15, 2015 at 06:38:54PM +0200, Jens Kuske wrote: > Add a remove function and export the init and remove function > to allow us to build the SoC specific drivers as modules. >=20 > Signed-off-by: Jens Kuske > --- > drivers/pinctrl/sunxi/pinctrl-sunxi.c | 25 +++++++++++++++++++------ > drivers/pinctrl/sunxi/pinctrl-sunxi.h | 2 ++ > 2 files changed, 21 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunx= i/pinctrl-sunxi.c > index f8e171b..4ef6b3d 100644 > --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c > +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c > @@ -856,7 +856,6 @@ int sunxi_pinctrl_init(struct platform_device *pdev, > struct sunxi_pinctrl *pctl; > struct resource *res; > int i, ret, last_pin; > - struct clk *clk; > =20 > pctl =3D devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); > if (!pctl) > @@ -954,13 +953,13 @@ int sunxi_pinctrl_init(struct platform_device *pdev, > goto gpiochip_error; > } > =20 > - clk =3D devm_clk_get(&pdev->dev, NULL); > - if (IS_ERR(clk)) { > - ret =3D PTR_ERR(clk); > + pctl->clk =3D devm_clk_get(&pdev->dev, NULL); > + if (IS_ERR(pctl->clk)) { > + ret =3D PTR_ERR(pctl->clk); > goto gpiochip_error; > } > =20 > - ret =3D clk_prepare_enable(clk); > + ret =3D clk_prepare_enable(pctl->clk); > if (ret) > goto gpiochip_error; > =20 > @@ -1015,10 +1014,24 @@ int sunxi_pinctrl_init(struct platform_device *pd= ev, > return 0; > =20 > clk_error: > - clk_disable_unprepare(clk); > + clk_disable_unprepare(pctl->clk); > gpiochip_error: > gpiochip_remove(pctl->chip); > pinctrl_error: > pinctrl_unregister(pctl->pctl_dev); > return ret; > } > +EXPORT_SYMBOL(sunxi_pinctrl_init); > + > +int sunxi_pinctrl_remove(struct platform_device *pdev) > +{ > + struct sunxi_pinctrl *pctl =3D platform_get_drvdata(pdev); > + > + gpiochip_remove(pctl->chip); > + pinctrl_unregister(pctl->pctl_dev); > + > + clk_disable_unprepare(pctl->clk); We should also remove the domain and the interrupt mapping here. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --ZvvH1QDaOFG4lOZN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVWKNqAAoJEBx+YmzsjxAgtzQP/jujYxIGAt6KEDS/s9K1ZKSj 5dH2DZA5DLUHuGFbXDdOKmnqBKwb3jNPPJ1P9Kz63Uud1rXl0C+u0XE/Hc/bVFpk 2U9cSs0DwnaqQiWT5Kp3q6YSVT9Mz7CYeTYwu9eTXB5le9Na26GMnMQ0anGhJRij TrSkYiDJTVPC0f0hYap8w//mUrU0D+rN3wBsJ0w5AcQEaFXuwQIuC7tkZAVhbAxZ fLx3v8Z00E/tJ+rZe8B1NtAaz6OSFzqpa3F7hSLix/5bF+XsNTv+M6QwoC6xe7Uu lK8mHWyTCrJ7u67LWww/+V+IH/z/LtemCxtIDh05MUWBc06yZOVQ9UZ8GvMrVPYW bntyJr7BDIvcNZ9JZJzefn5ByqpiCKXIptpT99OCLci9bvdKfkIei0XH/xD8f8IF qWWofqffXxGXWZx3z8meh0QyJOCQKe7xm0ZvL/SK1DuSq9bYaCiZhxj6j+m7863M 5BxsLGaIFRS1+1f1bD5ccvM8M2fZsIu3M6vlF+Cncqdb4Pn5buHkzv+LcBm9axOp BjUiMSYkDPkmfz9p+zruQafS0ho9aqfI+DYiAQntkaSLaHrnSPFpQPyA619XEbnZ 12G5fQM7bBLdoaN8i6K6bu49SbawAaDnEYFvey3C4WcP8XyfmxYhbV6VrnxPc81M +ZuU/WMvcok4QLfhQ25i =DJHT -----END PGP SIGNATURE----- --ZvvH1QDaOFG4lOZN-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/