From patchwork Wed Apr 8 11:20:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6178631 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 D67E59F2E9 for ; Wed, 8 Apr 2015 11:23:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1455E2035D for ; Wed, 8 Apr 2015 11:23:59 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 74A0820373 for ; Wed, 8 Apr 2015 11:23:57 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id ADFDB26548D; Wed, 8 Apr 2015 13:23:56 +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 237972652D1; Wed, 8 Apr 2015 13:22:25 +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 B792726535F; Wed, 8 Apr 2015 13:22:23 +0200 (CEST) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by alsa0.perex.cz (Postfix) with ESMTP id 2BF532652AC for ; Wed, 8 Apr 2015 13:21:19 +0200 (CEST) Received: by pacyx8 with SMTP id yx8so111449078pac.1 for ; Wed, 08 Apr 2015 04:21:18 -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=hpYqIDTiiqYfanr+LyRsSeIG2zFgghO0N3VmbTW7nS0=; b=t5M+O4DeV5gkpTOAf9Lu665skKBowbHikDElKSYKD8ZeUDabRJkAO0ittAbnhQb+Ln dYYXsYhD0WKlHNHIwc6QLo/FuyWtTgbrYL3zs5IMUDjuh4s8Q0+bZmc4AD/Kq1tldH7F VEmPrgsY9mTvGr/xY7KA/dFFANbpqzOdbgHnMib7c/jkPfjtuz4yzqxDFXjSOg0h0ifV VD+N0HJqSaLF4U7O3WXbPWFxTKfo+7C8P/r3vFKatGBh2KoRHmBTfZtSY0Or8UuZcQLd VTZBbvsCPh6/XzHRaYcCmRxg8rqxzNOK9bgdAG9e4j35T6d+pECBlA9PgdQpka1mkulk dKgg== X-Received: by 10.70.103.230 with SMTP id fz6mr29501200pdb.1.1428492078453; Wed, 08 Apr 2015 04:21:18 -0700 (PDT) Received: from localhost.localdomain ([122.169.147.27]) by mx.google.com with ESMTPSA id og11sm10973411pdb.91.2015.04.08.04.21.12 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Apr 2015 04:21:17 -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:29 +0530 Message-Id: <1428492040-5581-4-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 03/14] ALSA: mts64: 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/mts64.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index 2a008a9..fb6223e 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -874,32 +874,35 @@ static int snd_mts64_probe_port(struct parport *p) return res; } -static void snd_mts64_attach(struct parport *p) +static int snd_mts64_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_mts64_detach(struct parport *p)