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: 6178621 Return-Path: X-Original-To: patchwork-linux-scsi@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 E4063BF4A6 for ; Wed, 8 Apr 2015 11:23:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FCE4201EC for ; Wed, 8 Apr 2015 11:23:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 365822011D for ; Wed, 8 Apr 2015 11:23:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754001AbbDHLWI (ORCPT ); Wed, 8 Apr 2015 07:22:08 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:35869 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753938AbbDHLWD (ORCPT ); Wed, 8 Apr 2015 07:22:03 -0400 Received: by pabsx10 with SMTP id sx10so111821666pab.3; 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 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 10/14] pps: return proper error values from attach 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> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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/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)