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: 6178511 Return-Path: X-Original-To: patchwork-linux-spi@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 6D2609F2E9 for ; Wed, 8 Apr 2015 11:22:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 953A92011D for ; Wed, 8 Apr 2015 11:22:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6622920357 for ; Wed, 8 Apr 2015 11:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754078AbbDHLWZ (ORCPT ); Wed, 8 Apr 2015 07:22:25 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:33609 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754042AbbDHLWP (ORCPT ); Wed, 8 Apr 2015 07:22:15 -0400 Received: by pdbnk13 with SMTP id nk13so112442761pdb.0; 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 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, Sudip Mukherjee Subject: [PATCH 12/14] i2c-parport: return proper error values from attach 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> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID, T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.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)