From patchwork Wed Apr 8 11:20:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6178681 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 05DB7BF4A6 for ; Wed, 8 Apr 2015 11:24:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 306E12035D for ; Wed, 8 Apr 2015 11:24:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EA5BA201EC for ; Wed, 8 Apr 2015 11:24:52 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id DC32B2654ED; Wed, 8 Apr 2015 13:24:51 +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 BC84D265373; Wed, 8 Apr 2015 13:22:30 +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 87D7226533F; Wed, 8 Apr 2015 13:22:29 +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 6EEF22652C4 for ; Wed, 8 Apr 2015 13:21:25 +0200 (CEST) Received: by pdbnk13 with SMTP id nk13so112422945pdb.0 for ; Wed, 08 Apr 2015 04:21:24 -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=BmIjaL187PgxFLCK20GmFa6PqXVgh+zM5ZuPkU3mPDE=; b=DlDuQzA/rPLuLJuQUzeqBd5z+tny+yMVCQhVy2kRLvDmcfbfHmqbGHrccpTFrvv8gl GBACJXNtLxv9aZord9eZAlPCvoe7EqWJlKnXNX3S8DOWBKbzU3XOZ5KS3mg3DKG4q6o9 fcuN0uf98RMezqbx6cmx+qdgoqwDlMzj6QPI7XluDB1pP0CV0pxI3vWRm6n064gGB12G sbtIq0sf5r1I1oi2tkvXYv1MozH7njdyYGAz1JhhqosHdLJZeL18Zotxcp43KN3CwLNI uZjqJNIn0WWyzqVLPdwRo+VUyDMY5MSc8PMOiG94qadTkJbP3rdEUYo/9Yw/DsBh3yzG E7hg== X-Received: by 10.70.91.167 with SMTP id cf7mr45028283pdb.7.1428492084820; Wed, 08 Apr 2015 04:21:24 -0700 (PDT) Received: from localhost.localdomain ([122.169.147.27]) by mx.google.com with ESMTPSA id og11sm10973411pdb.91.2015.04.08.04.21.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Apr 2015 04:21:24 -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:30 +0530 Message-Id: <1428492040-5581-5-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 04/14] staging: panel: 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/staging/panel/panel.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index ea54fb4..61f6961 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c @@ -2188,15 +2188,15 @@ static struct notifier_block panel_notifier = { 0 }; -static void panel_attach(struct parport *port) +static int panel_attach(struct parport *port) { if (port->number != parport) - return; + return -ENODEV; if (pprt) { pr_err("%s: port->number=%d parport=%d, already registered!\n", __func__, port->number, parport); - return; + return -EALREADY; } pprt = parport_register_device(port, "panel", NULL, NULL, /* pf, kf */ @@ -2206,7 +2206,7 @@ static void panel_attach(struct parport *port) if (pprt == NULL) { pr_err("%s: port->number=%d parport=%d, parport_register_device() failed\n", __func__, port->number, parport); - return; + return -ENODEV; } if (parport_claim(pprt)) { @@ -2230,7 +2230,7 @@ static void panel_attach(struct parport *port) goto err_lcd_unreg; } register_reboot_notifier(&panel_notifier); - return; + return 0; err_lcd_unreg: if (lcd.enabled) @@ -2238,6 +2238,7 @@ err_lcd_unreg: err_unreg_device: parport_unregister_device(pprt); pprt = NULL; + return -ENODEV; } static void panel_detach(struct parport *port)