Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3251553imu; Sun, 9 Dec 2018 21:39:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/VycaOQPaSCGHyP2++dj2ynbMf9tESvcUjF9TyjIkMP6+gCbkVX401SaVH4PUZPqY2FJHHo X-Received: by 2002:a62:f247:: with SMTP id y7mr11151033pfl.25.1544420388249; Sun, 09 Dec 2018 21:39:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544420388; cv=none; d=google.com; s=arc-20160816; b=t95XRzvJ1P54pS7x9GNmrWIlxoa3Un2DFYanuDSaurMirXXHankWI3oHWK5s5qncK5 pYSGtNYxpMZ3TZuw/Tg/QFQvJD2COGJRyGoRs34CbI5iDSPjpVBkXUusMHBK81lTmCt1 ggFioyHx1DJEwcFIC+OQFShQZiil+NQzzelbqkrNCPl6k+PROJFZZtbIX3xfpOcPRMd4 H9WjT5bf7RpVNbJdkZDjEQIenpiuocm2mklyD2Nom+EqwekSTPPDG8kSDrfgHI047Sh0 teYbRL0vii2cbKDwb62nRuYg0x0efoXVv7po/PnjPMfbi6Uopy8CZ7L1Ou13lIDxrGJe juWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=wjluZy7lmyQceRQPYRsAvUrjLOu0mPkKk+tXAFgDoSU=; b=ed5ehTSBJFEuMnmUm0UNoaR7umIUfm9TZz6f4d9wIlvUF9pt+255VM8AXzYNCl/h8F mrZpoI5euEwda69y3dWvLlgPOIs/9HaKvfU/ph94q+1lX10SJvBfU6OTh2YuRdRkm3DO lyr1ukhicLrsiqJ0Xn5RUG/JObEt2uz5BYyhPQmwFNX5QrHBaR1Iu7zk7VMS0DP2IYla 9HOsFAqoa7LoDnCpMxPRn0Tw17zYb/3Zj7+GSPg4WvX4sSTHSzX2w42peSA9xM0vK/L6 sTSvcLLOUXxpbhf3O+xhcYuBzo2lRBN9TjHIIGH/NIxybpK49fdP+Dy9U8UrLD56gDqU 2B/g== 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 n125si9485096pga.179.2018.12.09.21.39.32; Sun, 09 Dec 2018 21:39:48 -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 S1726468AbeLJFin (ORCPT + 99 others); Mon, 10 Dec 2018 00:38:43 -0500 Received: from ozlabs.org ([203.11.71.1]:44747 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbeLJFin (ORCPT ); Mon, 10 Dec 2018 00:38:43 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 43CsLn2B9jz9s4s; Mon, 10 Dec 2018 16:38:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Rob Herring , 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: Re: [PATCH v2] misc: cxl: Use device_type helpers to access the node type In-Reply-To: <20181205191655.14612-1-robh@kernel.org> References: <20181205191655.14612-1-robh@kernel.org> Date: Mon, 10 Dec 2018 16:38:35 +1100 Message-ID: <878t0yeyas.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rob Herring writes: > 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. I already have v1 in my next. cheers > 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++; > } > -- > 2.19.1