[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55252E09.2060600@cogentembedded.com>
Date: Wed, 08 Apr 2015 16:32:57 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jean Delvare <jdelvare@...e.de>,
Wolfram Sang <wsa@...-dreams.de>,
Rodolfo Giometti <giometti@...eenne.com>,
"James E.J. Bottomley" <JBottomley@...allels.com>,
Mark Brown <broonie@...nel.org>,
Willy Tarreau <willy@...a-x.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>
CC: linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
netdev@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-spi@...r.kernel.org, devel@...verdev.osuosl.org,
alsa-devel@...a-project.org
Subject: Re: [PATCH 02/14] ALSA: portman2x4: return proper error values from
attach
Hello.
On 4/8/2015 2:20 PM, Sudip Mukherjee wrote:
> now that we are monitoring the return value from attach, make the
So you've first changed the method prototype and follow up with the
changes to the actual implementations? That's backward. I'm afraid such
changes can't be done piecemeal.
> required changes to return proper value from its attach function.
> Signed-off-by: Sudip Mukherjee <sudip@...torindia.org>
> ---
> sound/drivers/portman2x4.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
> diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c
> index 464385a..866adbb 100644
> --- a/sound/drivers/portman2x4.c
> +++ b/sound/drivers/portman2x4.c
> @@ -672,32 +672,37 @@ static int snd_portman_probe_port(struct parport *p)
> return res ? -EIO : 0;
> }
>
> -static void snd_portman_attach(struct parport *p)
> +static int snd_portman_attach(struct parport *p)
> {
> struct platform_device *device;
> + int ret;
>
> device = platform_device_alloc(PLATFORM_DRIVER, device_count);
> if (!device)
> - return;
> + return -ENOMEM;
>
> /* Temporary assignment to forward the parport */
> platform_set_drvdata(device, p);
>
> - if (platform_device_add(device) < 0) {
> + ret = platform_device_add(device);
> +
I don't think empty line is needed here.
> + if (ret < 0) {
> platform_device_put(device);
> - return;
> + return ret;
> }
>
[...]
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists