Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752846AbcD0Ff6 (ORCPT ); Wed, 27 Apr 2016 01:35:58 -0400 Received: from mga04.intel.com ([192.55.52.120]:32172 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752541AbcD0Ff5 (ORCPT ); Wed, 27 Apr 2016 01:35:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,540,1455004800"; d="asc'?scan'208";a="953776385" From: Felipe Balbi To: Jisheng Zhang , mathias.nyman@linux.intel.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, yendapally.reddy@broadcom.com, Jisheng Zhang Subject: Re: [RESEND PATCH v2 5/7] usb: xhci: plat: Remove checks for optional clock in error/remove path In-Reply-To: <1461675460-2295-6-git-send-email-jszhang@marvell.com> References: <1461675460-2295-1-git-send-email-jszhang@marvell.com> <1461675460-2295-6-git-send-email-jszhang@marvell.com> User-Agent: Notmuch/0.21+96~g9bbc54b (http://notmuchmail.org) Emacs/25.0.90.3 (x86_64-pc-linux-gnu) Date: Wed, 27 Apr 2016 08:33:52 +0300 Message-ID: <87h9enpqdb.fsf@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2479 Lines: 78 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Jisheng Zhang writes: > Commit 63589e92c2d9 ("clk: Ignore error and NULL pointers passed to > clk_{unprepare, disable}()") allows NULL or error pointer to be passed > unconditionally. > > This patch is to simplify probe error and remove code paths. this seems wrong to me. xhci->clk isn't initialized to NULL, it's either initialized to a valid struct clk * or some ERR_PTR() value. Care to explain ? > Signed-off-by: Jisheng Zhang > --- > drivers/usb/host/xhci-plat.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > index 0e69712..83669d0 100644 > --- a/drivers/usb/host/xhci-plat.c > +++ b/drivers/usb/host/xhci-plat.c > @@ -266,8 +266,7 @@ put_usb3_hcd: > usb_put_hcd(xhci->shared_hcd); >=20=20 > disable_clk: > - if (!IS_ERR(clk)) > - clk_disable_unprepare(clk); > + clk_disable_unprepare(clk); >=20=20 > put_hcd: > usb_put_hcd(hcd); > @@ -287,8 +286,7 @@ static int xhci_plat_remove(struct platform_device *d= ev) > usb_remove_hcd(hcd); > usb_put_hcd(xhci->shared_hcd); >=20=20 > - if (!IS_ERR(clk)) > - clk_disable_unprepare(clk); > + clk_disable_unprepare(clk); > usb_put_hcd(hcd); >=20=20 > return 0; > --=20 > 2.8.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXIE9AAAoJEIaOsuA1yqREBAcP/0JuogEjzlDWeaHrllVI7uev xmvQjanMrC6ZNz5WdPyPqDH0YC4qsmDVuLa19EtASZLXI+bzhXH2j5jOMzWoAwQl bI170ckelyB1Amp6VECfD4iXNAT+j6HZ0615z/l6xXLRTM2QbX6M/JGDAAcqmHxR pwy5v1eoA1gdsOLD+/AmDaqOok2pdHzIlh3EKUIqFCmYJqwKhoXqDo1/ZK0npIVG QuZu1LGmDHvphKrAEeqIsnuql0Q0Bqyx5S+jZR+laf+AqY+LmkcQuBLhAb7yBVpC irYUyZjOSxNObn68YpNJznMVdiBoXo0hNcFxHDVJeoLk7p50Eu8CqUSzrHEKkxT/ elqp0lEXRwtMJKM4dl2AYkiPeH35Vhty2UUrlI5giltk6leR+xYBC0DjGti+VqMV PREDkRdLfCTk+fu/Du8LfpE8SZH5Koo42P0XXpxLbR4HnOXwcRN1xEAZFyDqQoMQ a2czM6lNRATI0C+0pKLOs4BRkeVj375+BCtyu9qT98UD2tzBmZbjrWFAKtgllt3P ur8mCNHhmNtYglWXEMtjIaEhH5JxpBiZayy7QmmkgxUr/llJGAZVgDesXzbz8mMX 5hTi1ugFpkDHf95IAEOERTptKUR41g2pRpc3eIYfCK9GslXvMqMRCGuX5zUnN9ta Y3cv1o73MR8dyOFBgTBZ =l56Z -----END PGP SIGNATURE----- --=-=-=--