From patchwork Wed Apr 8 11:20:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6178901 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 89480BF4A6 for ; Wed, 8 Apr 2015 11:28:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B15262035D for ; Wed, 8 Apr 2015 11:28:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0B1A12034F for ; Wed, 8 Apr 2015 11:28:55 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 392FB2657ED; Wed, 8 Apr 2015 13:28:54 +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, 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 65553265341; Wed, 8 Apr 2015 13:23:49 +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 20F09265473; Wed, 8 Apr 2015 13:23:46 +0200 (CEST) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by alsa0.perex.cz (Postfix) with ESMTP id 7762E265307 for ; Wed, 8 Apr 2015 13:22:15 +0200 (CEST) Received: by paboj16 with SMTP id oj16so111961996pab.0 for ; Wed, 08 Apr 2015 04:22:14 -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=YuU3Fnm8yjRymwk6My2Q5ZT2jMHWpnsiNs8EegCTij0=; b=M4s2wn0psK+RhyyEKlSB2g2v34aIt7IKGqUbP/kVk2B4ME2Xx6OtLlJ0hkjE1Vrw51 RadgTT29eciI45U4kOX3qXYwLPLC5UJPh+Ym4nIa3SLGeQ0BaOvpGx4OCOENrTFV6E8z L3BxYgwDaZGBlKrhtoAT1p3336Bak2tU47qIgBt7+y201aD0T9Awo2gy+CgwMn5qCzok r7CqenycSrk1qcFNihII94dwVU1YBag0SwdSsU/tyrSlBplxmzo1irwHbTkC0UgBmPwb oh/5gRfkfGWaarjJMuhPz0EvU1XGp01NY1QFc9hcdhuRUffBceh36EWXJTVQDeNfUDZ2 MRaw== X-Received: by 10.70.138.8 with SMTP id qm8mr45285392pdb.96.1428492134857; Wed, 08 Apr 2015 04:22:14 -0700 (PDT) Received: from localhost.localdomain ([122.169.147.27]) by mx.google.com with ESMTPSA id og11sm10973411pdb.91.2015.04.08.04.22.08 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Apr 2015 04:22:14 -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:38 +0530 Message-Id: <1428492040-5581-13-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 12/14] i2c-parport: 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 --- drivers/i2c/busses/i2c-parport.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index a1fac5a..761a775 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c @@ -160,14 +160,14 @@ static void i2c_parport_irq(void *data) "SMBus alert received but no ARA client!\n"); } -static void i2c_parport_attach(struct parport *port) +static int i2c_parport_attach(struct parport *port) { struct i2c_par *adapter; adapter = kzalloc(sizeof(struct i2c_par), GFP_KERNEL); if (adapter == NULL) { printk(KERN_ERR "i2c-parport: Failed to kzalloc\n"); - return; + return -ENOMEM; } pr_debug("i2c-parport: attaching to %s\n", port->name); @@ -230,13 +230,14 @@ static void i2c_parport_attach(struct parport *port) mutex_lock(&adapter_list_lock); list_add_tail(&adapter->node, &adapter_list); mutex_unlock(&adapter_list_lock); - return; + return 0; err_unregister: parport_release(adapter->pdev); parport_unregister_device(adapter->pdev); err_free: kfree(adapter); + return -ENODEV; } static void i2c_parport_detach(struct parport *port)