From patchwork Wed Apr 8 11:20:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6178911 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 E1F709F1C4 for ; Wed, 8 Apr 2015 11:29:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8DCA20357 for ; Wed, 8 Apr 2015 11:29:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B94242011E for ; Wed, 8 Apr 2015 11:29:26 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D4626265835; Wed, 8 Apr 2015 13:29:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: 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 142DC265474; Wed, 8 Apr 2015 13:23:55 +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 8A79F265351; Wed, 8 Apr 2015 13:23:53 +0200 (CEST) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by alsa0.perex.cz (Postfix) with ESMTP id BBE2A265357 for ; Wed, 8 Apr 2015 13:22:21 +0200 (CEST) Received: by paboj16 with SMTP id oj16so111964164pab.0 for ; Wed, 08 Apr 2015 04:22:21 -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=8aZS9lxv/NEtbl9kIRItPFRjUkPkqf8TVcGWc6ce8L4=; b=MnihqdvccwLzUTiCZelSg7Ds9Ft4+3nauTBV3diKZjSEpU50pIWUzClZLIyHyT5uOG IEKoSCoYOtNa8vZc4pNRLG+7EFogq4YVX+bJbSGsfFn2ho48y/GlmHRttrOrYWKr6AaU JUik+WupGRFaZnJWtw8O0rxK4ZMWSImRu2Onb52LlyfIVKzTDGQBx9ZqJSh+SPL3TUtl 6N9CKjxKTCk4zjVDUIBZPu5FLjiuR2pfDyE7Azl7Pr0pKWHIj3REdvETTbEd3y8i30Go adi/5d8+jOQIbC5YCjUMj+GJmAHHm/jlw7/KS6w5DlMxR+XXBFaPdzA0Gk1GN8AeZ0+4 EayQ== X-Received: by 10.70.53.3 with SMTP id x3mr45504459pdo.133.1428492141057; Wed, 08 Apr 2015 04:22:21 -0700 (PDT) Received: from localhost.localdomain ([122.169.147.27]) by mx.google.com with ESMTPSA id og11sm10973411pdb.91.2015.04.08.04.22.15 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Apr 2015 04:22:20 -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:39 +0530 Message-Id: <1428492040-5581-14-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 13/14] ppdev: 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/char/ppdev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index ae0b42b..14374d7 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -748,10 +748,14 @@ static const struct file_operations pp_fops = { .release = pp_release, }; -static void pp_attach(struct parport *port) +static int pp_attach(struct parport *port) { - device_create(ppdev_class, port->dev, MKDEV(PP_MAJOR, port->number), - NULL, "parport%d", port->number); + struct device *dev; + + dev = device_create(ppdev_class, port->dev, + MKDEV(PP_MAJOR, port->number), NULL, + "parport%d", port->number); + return PTR_ERR_OR_ZERO(dev); } static void pp_detach(struct parport *port)