From patchwork Wed Sep 19 10:34:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10605599 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CCD41508 for ; Wed, 19 Sep 2018 10:34:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4587628A62 for ; Wed, 19 Sep 2018 10:34:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 394572B47F; Wed, 19 Sep 2018 10:34:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D13C328A62 for ; Wed, 19 Sep 2018 10:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731188AbeISQLo (ORCPT ); Wed, 19 Sep 2018 12:11:44 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:43426 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730923AbeISQLo (ORCPT ); Wed, 19 Sep 2018 12:11:44 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8JAYIoQ182354; Wed, 19 Sep 2018 10:34:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=JnWC5KIaZfdpkthsB8xMu6pbK86lPVV30u8kjXjnrCA=; b=ug3HKIPwqTU47eXxTUkgWV51W2IcU+Q9V/2cgNL0GfLkTw9i2GPT/BMmlidU6n7iqmtx 0BYyoHb3gs7U8+bdzUrkWDcIS/Qrj9XLHAIGNgqJZP0KfiVz9bx3D/pE08DaLNILYIs0 hVjYzQODYRH/lJn0id/BjWlDAU27MeMBQVNqe8xR17k4a15LlPb7RlKfVLZrAkvmj9Qw MXeQlouSF9DtVIiyqYf6ljFlQMOSvbYwKvdvnIs/udl8RiUhvyZ4InYPzbzW/PMsgxxq DlbHkIh472lUUA5UNP6cwjXw6EB2U/YODM+ou9mD2yNgpYmKrdSwAW3DdXodnSmVFzdy lg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2mgsgtt5fb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Sep 2018 10:34:18 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8JAYHk6021680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Sep 2018 10:34:17 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w8JAYHfE008346; Wed, 19 Sep 2018 10:34:17 GMT Received: from mwanda (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 19 Sep 2018 03:34:17 -0700 Date: Wed, 19 Sep 2018 13:34:11 +0300 From: Dan Carpenter To: Alan Douglas Cc: Lorenzo Pieralisi , Bjorn Helgaas , linux-pci@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] PCI: cadence: check the correct variable Message-ID: <20180919103411.GA9238@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9020 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=989 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809190110 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We should be checking "phy[i]" instead of "phy". Fixes: dfb80534692d ("PCI: cadence: Add generic PHY support to host and EP drivers") Signed-off-by: Dan Carpenter diff --git a/drivers/pci/controller/pcie-cadence.c b/drivers/pci/controller/pcie-cadence.c index 86f1b002c846..5e369dd183c8 100644 --- a/drivers/pci/controller/pcie-cadence.c +++ b/drivers/pci/controller/pcie-cadence.c @@ -191,8 +191,8 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie) for (i = 0; i < phy_count; i++) { of_property_read_string_index(np, "phy-names", i, &name); phy[i] = devm_phy_optional_get(dev, name); - if (IS_ERR(phy)) - return PTR_ERR(phy); + if (IS_ERR(phy[i])) + return PTR_ERR(phy[i]); link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS); if (!link[i]) {