From patchwork Wed Apr 8 11:20:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6178881 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 C428F9F1C4 for ; Wed, 8 Apr 2015 11:28:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E68832034F for ; Wed, 8 Apr 2015 11:28:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7D4A42012D for ; Wed, 8 Apr 2015 11:28:02 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 99FAF26575E; Wed, 8 Apr 2015 13:27: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, 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 E4BB1265334; Wed, 8 Apr 2015 13:23:40 +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 459F4265466; Wed, 8 Apr 2015 13:23:39 +0200 (CEST) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by alsa0.perex.cz (Postfix) with ESMTP id 00347265317 for ; Wed, 8 Apr 2015 13:22:02 +0200 (CEST) Received: by pdea3 with SMTP id a3so112333969pde.3 for ; Wed, 08 Apr 2015 04:22:02 -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=Um33oI8v0Vjw1tHhtJRVCmn+n/aFCbiYo6JuQ7bMGvM=; b=AyAxk+xBsAfjSA+8hzuWUe1UwFq4iSiEi6Y+pmcL+ZLjWJ9DPVqXB5eaH/89XNkFlI lxtHKKzcW0zI++SIR8lLW0TqffE3EQ79SuO7qta5Knve3PGCwJagLic6+/X7YEx9eELN bREjJJK/6JWrXzdTrpqtpXVVeZPK5XumwJxY+tkiX9cbgw78Bpvovsgs7om+RxDZxjVb gHHV3p/006GVuzmCRGrastN/Ax88dYHKhl4eczxmr+xW59alJNzhkcpBOvkOSjslLut0 JED5Zo9i/s2MPHG85moGA5bjeD73qa7jQFClxDTQ7awuwxAIQ71DUt8zJwiAyq7L+6eE RrAA== X-Received: by 10.70.40.164 with SMTP id y4mr45562716pdk.25.1428492122281; Wed, 08 Apr 2015 04:22:02 -0700 (PDT) Received: from localhost.localdomain ([122.169.147.27]) by mx.google.com with ESMTPSA id og11sm10973411pdb.91.2015.04.08.04.21.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Apr 2015 04:22:01 -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:36 +0530 Message-Id: <1428492040-5581-11-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 10/14] pps: 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/pps/clients/pps_parport.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c index 38a8bbe..a411621 100644 --- a/drivers/pps/clients/pps_parport.c +++ b/drivers/pps/clients/pps_parport.c @@ -134,7 +134,7 @@ out_both: return; } -static void parport_attach(struct parport *port) +static int parport_attach(struct parport *port) { struct pps_client_pp *device; struct pps_source_info info = { @@ -151,7 +151,7 @@ static void parport_attach(struct parport *port) device = kzalloc(sizeof(struct pps_client_pp), GFP_KERNEL); if (!device) { pr_err("memory allocation failed, not attaching\n"); - return; + return -ENOMEM; } device->pardev = parport_register_device(port, KBUILD_MODNAME, @@ -179,7 +179,7 @@ static void parport_attach(struct parport *port) pr_info("attached to %s\n", port->name); - return; + return 0; err_release_dev: parport_release(device->pardev); @@ -187,6 +187,7 @@ err_unregister_dev: parport_unregister_device(device->pardev); err_free: kfree(device); + return -ENODEV; } static void parport_detach(struct parport *port)