Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3321978iog; Mon, 20 Jun 2022 17:12:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sJDD/yb/w/PdiL4ykMlBs8cdWDzm8IgT6zw9SIw+O3lUtKPEmDEKHMUOskZ3e2K3LnTw+D X-Received: by 2002:a17:907:868c:b0:722:bc0b:500e with SMTP id qa12-20020a170907868c00b00722bc0b500emr7969920ejc.703.1655770336886; Mon, 20 Jun 2022 17:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655770336; cv=none; d=google.com; s=arc-20160816; b=hYLf7oecqSb7LpoAycxRU0A0xHCljMMRM+6+pQpnH9uqmmhpxJ3+oB5Z7kcxjsLs4d r9twbmIqImwAy+gqbzpravQcah5VPn4FuHMy/OHEF3J04s/LEnUVFv80rqNM5EOKr+px DcMhdYe/M1bivHI6a6SzQi0uzy42QuvLMMFMbcVPnz9kcqF7cZiyunyOcobAMtloseHT y3buaNxNCi2JB2GiJea3qYw3cRTBBjFIx0jgoFKgyMUYdITAEqI7DYYmtq2bR7osW/UU nO2N95lbdsXCvsKHLaauGIK+RYIqMmZiDYhOwhedcUwAql6kvrm01ku8PD9QOYP0W+hs RJ2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ACcSzE4sPLh5igtp0kQduOVThK6iLFRZoulI2hJyWco=; b=GSDfL6k5X5L6aROvgEg451XnjgSAovy54z4WuUElDpXO7f29+2seAHtTQbl6ACcTaq Zpg85cb8UPvMSdANL397ZEkBJa2vgmXOJ+1J4ikpo5kdloDWtS6Zon2yO1w16Z46Rvpz C48ngqUfIwPH8OYnt9HKRQp6E/qtJ8eGK50YmKTo8RshJoB6YHfnJZsvWbdsyjvWkO2V JzxOFgLiyeNVxn/AHZyBdqqiGJJ01DafC17php+U1hpOCSxjLcVe5NQXkmTqDP402ckX IbVp7kbelygd8Lf52vXeNM+it9cPSRhtEKnqHSNUjZ+btBkeP9XLqVK49IH6l0eYRhxp VQNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=hShbXi9D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr15-20020a1709073f8f00b0071097667454si15162943ejc.800.2022.06.20.17.11.51; Mon, 20 Jun 2022 17:12:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=hShbXi9D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347691AbiFTXUq (ORCPT + 99 others); Mon, 20 Jun 2022 19:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347417AbiFTXUW (ORCPT ); Mon, 20 Jun 2022 19:20:22 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8386E29C99 for ; Mon, 20 Jun 2022 16:15:58 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id d19so13505120lji.10 for ; Mon, 20 Jun 2022 16:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ACcSzE4sPLh5igtp0kQduOVThK6iLFRZoulI2hJyWco=; b=hShbXi9DeSIHJxr+LGTJrhcvHPOZYClup9h4zZQerQLWfESumk+PhHCCBam/CMpvRJ 5bBT9guyuQnzWc1vSirHQAoaeft8QqzvUKg59HcEPdeWmPxk6+TBQNTHmJI/CcZnOOTb 41rx2/+SDo6OdOPZz0d7aUUIiGAztoc4AlLyC5AG+bsYY9OqMTwxk/xTCmZSQHx9uSzC nw9WuGQBkIXofSjXKRBxuPSVk9sH5ShOAPxPZC/5BgS8Py/6pt4J71gCMsNvUKQUPXu1 ZWyJezWdAv4pOHlg9+C52rlpSWnf9Q4Zv7pUeOTycQ+IXRGK9+2CwzscY+Aqr3ckXrhh 2H7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ACcSzE4sPLh5igtp0kQduOVThK6iLFRZoulI2hJyWco=; b=sM4Q3g6bdrHreo2yPZyzRQBEH7FUi2V22mv7n8ZuNIBxEONNt1Mjv9PU8cHrkV0iye 5wsqQlX3nab1IaP1q1/sIV4zpOFyKoZBxW6kLFEwwTx4cGvwSq16GXhh8K1VzT5doPmv Qu5IF/n/E6vhlRBZpSsyR5IPEFpfEfBt2lX10sd6KPHrwmmXrahmr1t2D3/729Lj4Lm9 KDHtfqCCT1dtBG9ZlGjkjLACdwfPIIgjwOhGzlPy4GCpI8Wqhftj43p+jaYG7uOJig3V F6fkjPNzbc8eD3zshpr2gyzVlf39D786DLm3smqxId1s0Yr0WPNcdBFJBkUnzPZlEuhe dn5g== X-Gm-Message-State: AJIora+fvbbVOWzDJGDzh99g6HhQnvaV3PmsQF0ddBzSeedQxeVz+ojy mV3Y7tJJvIIgiBeQQtzeNQpF07NMgjsZJdJAS2fw3g== X-Received: by 2002:a2e:9581:0:b0:24f:2dc9:6275 with SMTP id w1-20020a2e9581000000b0024f2dc96275mr12615993ljh.486.1655766955772; Mon, 20 Jun 2022 16:15:55 -0700 (PDT) MIME-Version: 1.0 References: <20220620150225.1307946-1-mw@semihalf.com> <20220620150225.1307946-6-mw@semihalf.com> In-Reply-To: From: Marcin Wojtas Date: Tue, 21 Jun 2022 01:15:45 +0200 Message-ID: Subject: Re: [net-next: PATCH 05/12] net: core: switch to fwnode_find_net_device_by_node() To: Andy Shevchenko Cc: Linux Kernel Mailing List , ACPI Devel Maling List , netdev , "Rafael J. Wysocki" , Len Brown , Andrew Lunn , vivien.didelot@gmail.com, Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , pabeni@redhat.com, Russell King - ARM Linux , Heiner Kallweit , Grzegorz Bernacki , Grzegorz Jaszczyk , Tomasz Nowicki , Samer El-Haj-Mahmoud , upstream@semihalf.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pon., 20 cze 2022 o 19:46 Andy Shevchenko napisa=C5=82(a): > > On Mon, Jun 20, 2022 at 05:02:18PM +0200, Marcin Wojtas wrote: > > A helper function which allows getting the struct net_device pointer > > associated with a given device tree node can be more generic and > > also support alternative hardware description. Switch to fwnode_ > > and update the only existing caller in DSA subsystem. > > ... > > > +static int fwnode_dev_node_match(struct device *dev, const void *data) > > { > > for (; dev; dev =3D dev->parent) { > > - if (dev->of_node =3D=3D data) > > > + if (dev->fwnode =3D=3D data) > > > We have a helper in device/bus.h (?) device_match_fwnode(). > That's true, thanks. > > return 1; > > } > > But this all sounds like a good candidate to be generic. Do we have more = users > in the kernel of a such? > Do you mean fwnode_dev_node_match? I haven't noticed. Indeed, it may be worth to move this one to drivers/base/property.c - what do you think? Thanks, Marcin