From patchwork Wed Apr 8 11:20:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6178581 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6436E9F2E9 for ; Wed, 8 Apr 2015 11:23:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 940712035D for ; Wed, 8 Apr 2015 11:23:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7993A2011D for ; Wed, 8 Apr 2015 11:23:06 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 95BBA265314; Wed, 8 Apr 2015 13:23:03 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, RCVD_IN_SORBS_WEB, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 3838426528B; Wed, 8 Apr 2015 13:21:54 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5C6F6265317; Wed, 8 Apr 2015 13:21:52 +0200 (CEST) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by alsa0.perex.cz (Postfix) with ESMTP id 471902652CD for ; Wed, 8 Apr 2015 13:21:13 +0200 (CEST) Received: by pdea3 with SMTP id a3so112314133pde.3 for ; Wed, 08 Apr 2015 04:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z/uvxUIrW8ihFhplSLMQD6THYw8KVxU1wCBFT+QZSHM=; b=LW1Pjj/GOA8BdKQUpDSvJDQiYdjwc+ePtxt1J59Ee4/j1UxJUZlcnEW4ghXLGqihyc VdSp7nEY2q8niMihn0uPM40d8ngNi/rNkH8jNDYF1zK7/BeK4/DjUJ+TfdjzDrnnNwA2 cuGIBYnhGlLA91kITllcKGz0hX1fydqQGO4VxzhAMbwybeJJyQIdm3i1thI7f57R957v XPvLkq/wu7pXP4/pK1aqho79MXK0urPN5VSxJYM0infXrd18VuNrD6PM+3G8GgKHYPKx zphWU2Z0BFFDmTucA8+Jo9JN6MEHONyBDYPlWfwnlYfvFIsOck/yhZqQWsAR+kvwVlnR Z1Xg== X-Received: by 10.66.161.161 with SMTP id xt1mr45508398pab.35.1428492072254; Wed, 08 Apr 2015 04:21:12 -0700 (PDT) Received: from localhost.localdomain ([122.169.147.27]) by mx.google.com with ESMTPSA id og11sm10973411pdb.91.2015.04.08.04.21.06 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Apr 2015 04:21:11 -0700 (PDT) From: Sudip Mukherjee To: Arnd Bergmann , Greg Kroah-Hartman , Jean Delvare , Wolfram Sang , Rodolfo Giometti , "James E.J. Bottomley" , Mark Brown , Willy Tarreau , Jaroslav Kysela , Takashi Iwai Date: Wed, 8 Apr 2015 16:50:28 +0530 Message-Id: <1428492040-5581-3-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1428492040-5581-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1428492040-5581-1-git-send-email-sudipm.mukherjee@gmail.com> Cc: devel@driverdev.osuosl.org, alsa-devel@alsa-project.org, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-i2c@vger.kernel.org, Sudip Mukherjee Subject: [alsa-devel] [PATCH 02/14] ALSA: portman2x4: return proper error values from attach X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP now that we are monitoring the return value from attach, make the 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); + + if (ret < 0) { platform_device_put(device); - return; + return ret; } /* Since we dont get the return value of probe * We need to check if device probing succeeded or not */ if (!platform_get_drvdata(device)) { platform_device_unregister(device); - return; + return -ENODEV; } /* register device in global table */ platform_devices[device_count] = device; device_count++; + + return 0; } static void snd_portman_detach(struct parport *p)