From: Johan Hovold <johan@kernel.org>
To: Michal Simek <michal.simek@xilinx.com>
Cc: linux-kernel@vger.kernel.org, monstr@monstr.eu, git@xilinx.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Paul Cercueil <paul@crapouillou.net>,
linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: misc: usb3503: Fix logic in usb3503_init()
Date: Tue, 9 Feb 2021 13:01:11 +0100 [thread overview]
Message-ID: <YCJ5h889zBrzVzji@hovoldconsulting.com> (raw)
In-Reply-To: <4ae929dc31c170252154352d04e89c8456d91ca3.1612870239.git.michal.simek@xilinx.com>
On Tue, Feb 09, 2021 at 12:30:42PM +0100, Michal Simek wrote:
> Based on
> https://lore.kernel.org/linux-arm-kernel/YCJv59g3Tq2haDSa@kroah.com/
> initialization should fail if any registration fails.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> drivers/usb/misc/usb3503.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
> index 48099c6bf04c..3aae83fbebae 100644
> --- a/drivers/usb/misc/usb3503.c
> +++ b/drivers/usb/misc/usb3503.c
> @@ -409,13 +409,17 @@ static int __init usb3503_init(void)
> int err;
>
> err = i2c_add_driver(&usb3503_i2c_driver);
> - if (err != 0)
> + if (err) {
> pr_err("usb3503: Failed to register I2C driver: %d\n", err);
> + return err;
> + }
>
> err = platform_driver_register(&usb3503_platform_driver);
> - if (err != 0)
> + if (err) {
> pr_err("usb3503: Failed to register platform driver: %d\n",
> err);
You forgot to deregister the i2c driver.
> + return err;
> + }
>
> return 0;
> }
Johan
prev parent reply other threads:[~2021-02-09 12:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-09 11:30 [PATCH] usb: misc: usb3503: Fix logic in usb3503_init() Michal Simek
2021-02-09 11:59 ` Greg Kroah-Hartman
2021-02-09 12:01 ` Johan Hovold [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YCJ5h889zBrzVzji@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=git@xilinx.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=monstr@monstr.eu \
--cc=paul@crapouillou.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.