Received: by 10.223.176.5 with SMTP id f5csp1073371wra; Fri, 2 Feb 2018 10:42:31 -0800 (PST) X-Google-Smtp-Source: AH8x225N25FbOEpHvHK2PnhDfjU8Hgd6z3padO2aaOV/uI2bgz4EQbW41au+Ibwlk9cVaxKOAVm0 X-Received: by 2002:a17:902:6e8c:: with SMTP id v12-v6mr36639254plk.14.1517596951361; Fri, 02 Feb 2018 10:42:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517596951; cv=none; d=google.com; s=arc-20160816; b=R3phCpZDKc0CJHxTfhmj+/dNm8M0DBtmIgVyLjLA0gJOeJtel13T7HDysPiNqj9LCA YA76TvkqCsiwmGeutAOBnJZwr0EFaoJzUxktd0wKnLQ5s5xELrPQAPs6D/n26MzGjunT 3WAaFlBOvzrEsZVAOegrLmxRlC6c2vV+lWlkjNR5BpfTK+riHnsPvvdJIW9/i9s2TwvV Liw5im9nuAb1hisQJXOgoLQi7o1juIIUzcdAzSsGXGo4s0nryxRi8JlbLtQwvjR0FYFP o7JWfrdsAlfvig4C8ZfUWEnUAyH81rfA+HAQraPWjpnKiPBlkqJl2yfbDbpBDOJKACd6 SpQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Ad0wvlqsvafuoL/DPyt2WH1/Jb/ZU0BP+GZcGEaIK+Q=; b=ZRcPbIFJCy3+0fJUzJx+aohyyapj+5eOyI64QWwX6+JEtXyAVq+kUoZcS516I0FmNU qunoT/X/0iJpg4pIXNgPofRZicN9ZajNkdRb5TgkZKXtN6vapvKniMKCiBpvU/GmSvgV rP1ffUp4fW5SKCMnM3PPccZEc+45X1zwlrkZ5CkAULukHlWUU6BWeI0aVKysXwAnnsDg GgEzxj2ikiTCGge9EL3N8xdEhie1vHSjD2W/PPs9xI7PqOHLAZeOWKZZuXy4u0GqNOVA ZQEslcfXNUySF/VrlSgifd0CDv8awPBDjVQBmh9FVC3O12atuPuFjIwfAIfmmtO0A0im T+iA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e89-v6si156178plb.461.2018.02.02.10.42.16; Fri, 02 Feb 2018 10:42:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755154AbeBBSkZ (ORCPT + 99 others); Fri, 2 Feb 2018 13:40:25 -0500 Received: from mga18.intel.com ([134.134.136.126]:63572 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755004AbeBBSj7 (ORCPT ); Fri, 2 Feb 2018 13:39:59 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2018 10:39:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,450,1511856000"; d="scan'208";a="14589453" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 02 Feb 2018 10:39:57 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8968230F; Fri, 2 Feb 2018 20:39:56 +0200 (EET) From: Andy Shevchenko To: Sudip Mukherjee , linux-kernel@vger.kernel.org, Nikola Ciprich Cc: Andy Shevchenko Subject: [PATCH v1 4/8] parport: Don't shadow error codes in ->probe() Date: Fri, 2 Feb 2018 20:39:51 +0200 Message-Id: <20180202183955.85453-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180202183955.85453-1-andriy.shevchenko@linux.intel.com> References: <20180202183955.85453-1-andriy.shevchenko@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When ->probe() calls helper functions return theirs error codes instead of shadowing them. Signed-off-by: Andy Shevchenko --- drivers/parport/parport_serial.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c index ac72ad1cabf5..7cf847e6e660 100644 --- a/drivers/parport/parport_serial.c +++ b/drivers/parport/parport_serial.c @@ -536,12 +536,10 @@ static int serial_register(struct pci_dev *dev, const struct pci_device_id *id) struct serial_private *serial; board = &pci_parport_serial_boards[id->driver_data]; - if (board->num_ports == 0) return 0; serial = pciserial_init_ports(dev, board); - if (IS_ERR(serial)) return PTR_ERR(serial); @@ -627,14 +625,16 @@ static int parport_serial_pci_probe(struct pci_dev *dev, if (err) return err; - if (parport_register(dev, id)) - return -ENODEV; + err = parport_register(dev, id); + if (err) + return err; - if (serial_register (dev, id)) { + err = serial_register(dev, id); + if (err) { int i; for (i = 0; i < priv->num_par; i++) parport_pc_unregister_port (priv->port[i]); - return -ENODEV; + return err; } return 0; -- 2.15.1