From patchwork Wed Dec 5 19:16:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 152931 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9666963ljp; Wed, 5 Dec 2018 11:16:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/XlXK3El1Fb3bXh5E3GWmcTy8gNPF6tkiHPr685gSQ1sUtem2k70xWiYUknXp+0bjgA47+4 X-Received: by 2002:a63:9f19:: with SMTP id g25mr21463679pge.327.1544037419843; Wed, 05 Dec 2018 11:16:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544037419; cv=none; d=google.com; s=arc-20160816; b=nn42es8EOk/yp1k7MmppcjYrYEF8wDR2RO1Z04v+iJa+rU0lrcg8n9qozaQhI9Y1N7 GmS4GdcGjoU1bhk1vhGKHQMvXOuaU1ZnAiGpbTjY3bNwZC27wIJurj7zsz8bQeOy/YSp 86zh6wMcc8ZlbYKh8S0ebIem71E0PhTrUCvgTRj1kC914hIUznxfUS1sfr/HGqTIx0GX QTxPHp0qQ88a+PTLAeUELXEfiTdb/acpVJBqH7GBZowtmQaBOcEtoZKhs1J1EpTYjkdS 1BN4cJ9WUt8nl8rZ1GDOkk01TZt+gntsO9hTQX0M8dJ1Xu0KFS/8g8+kpgfBxwBhfjfE 5N8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vJ4tevbNbxREqSgsxj5/TEpmpw/iqRFq5WUY9yVtSgM=; b=si2dEjuib1nawfj8Z9OcUSIrMLzV5/iCSeRcXtF7KLnzL4jzV2SZrP8ZDTzlBsGTgw mYe6fJdX1gb+vwIFmZxKeLD6vJGVZwkTNEbvnCdqUVMJ72GlD/8hvsm4QvYskekJwXUJ hFCsloj4CYcL6R+rKshWTkfT27p2XzFw3CuR/5tZnhR77T8PC4xUku7FeyjZrqm/jqYf lYV6gObe3pJsN/i3Gl3AnLR8GsxZb2wyg4VfhOeihSnSvyNVtqoQlgZDZM/Kp9Kme9+F XCD4g8pDHaZwoU7Vogjt/78IpP9FFEy/8Pqm82VURHiIyQj/k+HUN5pwp79iQGzKkS1v OqAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az11si20800561plb.386.2018.12.05.11.16.59; Wed, 05 Dec 2018 11:16:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727349AbeLETQ6 (ORCPT + 6 others); Wed, 5 Dec 2018 14:16:58 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:34488 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727297AbeLETQ6 (ORCPT ); Wed, 5 Dec 2018 14:16:58 -0500 Received: by mail-oi1-f193.google.com with SMTP id h25so18576996oig.1; Wed, 05 Dec 2018 11:16:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vJ4tevbNbxREqSgsxj5/TEpmpw/iqRFq5WUY9yVtSgM=; b=iaMa3vmmt4XWnABo5ZwJWnrRg5SY9CRUXDnNM95Xi+73GB7o0pDAZPr+y+yMumwjbD zYtq8J8zTksjUDTrQOIQWdq5DAxyxMIRfPCokr6z+s/q7iknh8L4/4PC0PozTsQPZi0Y o6nStqSiDaJOxpvZCam6T/UGl8i1s5L1iZdGhUbjou75/BTOEtmCrBCBI1RAyvvA3+b2 X0Ceuta1BHr6g5oLnCyOBRelUzMnGt9Z+WGajaO1p/ZEHupE88COPJ18/bz+hMlgZmkB tfVU6iQ9CtEynLH2VUZNc5GiSQBI/8KLgyzxnK7fkdStGIBePAJUSdthstlN2MP7Gjhl Pgag== X-Gm-Message-State: AA+aEWYrYXeg6vNAqZ/Ie7DLd5z+VzyUNMSwBdI+hCxIY5yR2tbkQNhG w4zN5pII8cKuSdbYo1sOLw== X-Received: by 2002:aca:88a:: with SMTP id 132mr568804oii.224.1544037417673; Wed, 05 Dec 2018 11:16:57 -0800 (PST) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id f18sm7355241otl.18.2018.12.05.11.16.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 11:16:56 -0800 (PST) From: Rob Herring To: Greg Kroah-Hartman Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Frederic Barrat , Arnd Bergmann , linuxppc-dev@lists.ozlabs.org, Andrew Donnellan Subject: [PATCH v2] misc: cxl: Use device_type helpers to access the node type Date: Wed, 5 Dec 2018 13:16:55 -0600 Message-Id: <20181205191655.14612-1-robh@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Remove directly accessing device_type property and use the of_node_is_type accessor instead. While not using it here, this is part of eventually removing the struct device_node.type pointer. Cc: Frederic Barrat Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Andrew Donnellan Signed-off-by: Rob Herring --- v2: - Reword commit message as this change was using the .type ptr. drivers/misc/cxl/pci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.19.1 Acked-by: Frederic Barrat diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index b66d832d3233..c79ba1c699ad 100644 --- a/drivers/misc/cxl/pci.c +++ b/drivers/misc/cxl/pci.c @@ -1718,7 +1718,6 @@ int cxl_slot_is_switched(struct pci_dev *dev) { struct device_node *np; int depth = 0; - const __be32 *prop; if (!(np = pci_device_to_OF_node(dev))) { pr_err("cxl: np = NULL\n"); @@ -1727,8 +1726,7 @@ int cxl_slot_is_switched(struct pci_dev *dev) of_node_get(np); while (np) { np = of_get_next_parent(np); - prop = of_get_property(np, "device_type", NULL); - if (!prop || strcmp((char *)prop, "pciex")) + if (!of_node_is_type(np, "pciex")) break; depth++; }