From patchwork Wed Apr 8 11:20:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6178871 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 27065BF4A6 for ; Wed, 8 Apr 2015 11:27:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58DB02034F for ; Wed, 8 Apr 2015 11:27:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 30AA02011E for ; Wed, 8 Apr 2015 11:27:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5F97D26531A; Wed, 8 Apr 2015 13:27:28 +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 48E23265326; Wed, 8 Apr 2015 13:23:35 +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 9CDCB265450; Wed, 8 Apr 2015 13:23:34 +0200 (CEST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by alsa0.perex.cz (Postfix) with ESMTP id 45614265325 for ; Wed, 8 Apr 2015 13:21:57 +0200 (CEST) Received: by pabsx10 with SMTP id sx10so111819536pab.3 for ; Wed, 08 Apr 2015 04:21:56 -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=Jb30VWOwnVwMtt5QGIIuW3FTfnLPocQZ/KL2UYIj8LA=; b=MVdt6S0BwS2l/rDw87VwNf3U2MXa/FkwIZkl9CLwcQhVlVgkITPZOYRag6EfQBSnIg LEXB9OgwSb9ssYyoZ4SVNBcnoUMHC4PnDS/LaQqDyJ9HrzCepozB1ClEK/NHMVZbA5tJ NHXhIqm/dGzHrCLLApQJIcadXmEzIenMkk/t3jhHxY2RW/nwfJPDd+uwHIKLDyPF6TmH 2xxq89XFa154cvUp7KxaOLFLNR0VZWg9RqJ4KmHlrEsKYi051Q3dVOIzIPD4MlbfaDN0 YMumfnbyWgVENtVbmHO3RnNjcTsRQk230nADBzkpq/bFcedhd0Xt8RvLBlIKPAA05rEC /GJw== X-Received: by 10.68.222.131 with SMTP id qm3mr45225555pbc.55.1428492116134; Wed, 08 Apr 2015 04:21:56 -0700 (PDT) Received: from localhost.localdomain ([122.169.147.27]) by mx.google.com with ESMTPSA id og11sm10973411pdb.91.2015.04.08.04.21.50 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Apr 2015 04:21:55 -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:35 +0530 Message-Id: <1428492040-5581-10-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 09/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/generators/pps_gen_parport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c index dcd39fb..499f410 100644 --- a/drivers/pps/generators/pps_gen_parport.c +++ b/drivers/pps/generators/pps_gen_parport.c @@ -190,18 +190,18 @@ static inline ktime_t next_intr_time(struct pps_generator_pp *dev) dev->port_write_time + 3 * SAFETY_INTERVAL)); } -static void parport_attach(struct parport *port) +static int parport_attach(struct parport *port) { if (attached) { /* we already have a port */ - return; + return -EALREADY; } device.pardev = parport_register_device(port, KBUILD_MODNAME, NULL, NULL, NULL, PARPORT_FLAG_EXCL, &device); if (!device.pardev) { pr_err("couldn't register with %s\n", port->name); - return; + return -ENODEV; } if (parport_claim_or_block(device.pardev) < 0) { @@ -218,10 +218,11 @@ static void parport_attach(struct parport *port) device.timer.function = hrtimer_event; hrtimer_start(&device.timer, next_intr_time(&device), HRTIMER_MODE_ABS); - return; + return 0; err_unregister_dev: parport_unregister_device(device.pardev); + return -ENODEV; } static void parport_detach(struct parport *port)