From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754267AbbDHNdF (ORCPT ); Wed, 8 Apr 2015 09:33:05 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:36437 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070AbbDHNdB (ORCPT ); Wed, 8 Apr 2015 09:33:01 -0400 Message-ID: <55252E09.2060600@cogentembedded.com> Date: Wed, 08 Apr 2015 16:32:57 +0300 From: Sergei Shtylyov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Sudip Mukherjee , Arnd Bergmann , Greg Kroah-Hartman , Jean Delvare , Wolfram Sang , Rodolfo Giometti , "James E.J. Bottomley" , Mark Brown , Willy Tarreau , Jaroslav Kysela , Takashi Iwai CC: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, netdev@vger.kernel.org, linux-scsi@vger.kernel.org, linux-spi@vger.kernel.org, devel@driverdev.osuosl.org, alsa-devel@alsa-project.org Subject: Re: [PATCH 02/14] ALSA: portman2x4: return proper error values from attach References: <1428492040-5581-1-git-send-email-sudipm.mukherjee@gmail.com> <1428492040-5581-3-git-send-email-sudipm.mukherjee@gmail.com> In-Reply-To: <1428492040-5581-3-git-send-email-sudipm.mukherjee@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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