Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1268021imm; Tue, 15 May 2018 16:59:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrc+1pItcFM9jqKGUbxhrrAvINOLFRObteYvUDXEpPASopTMQ2XmRaV6298Ck8CMP+2tOhC X-Received: by 2002:a62:48d1:: with SMTP id q78-v6mr17346852pfi.70.1526428742866; Tue, 15 May 2018 16:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526428742; cv=none; d=google.com; s=arc-20160816; b=gg+Kt/Du0Jv4oze9+qyiOxUJS3ZjtIJRxLNS73ny2e0ECSeEPZLt+CqJVVewhGd6WF dj3QnQl6k4nYNS6sIQX4U2uD9oEFe8ERzU3pqUIq2DaIGKPQp6yhijdHXqIRPaG/ocvA ROJRDUq0zNE/a8nNiMkCBzeu1AuWkiI5/DKxz3bQF4+4Xa/mtgwaykYPLzAg+hSiMl9w 67fp2boqvD9G/mQOBtb0hm7YHm9nEJYHxFiwR+m09JAT2fILx3XCYG9DxjDsFZgNo5LP T71GhycXntoHu/z4th0IUfk7U6bgsY+iaqpPAB8dXGgf6OG6q6hYoGYJTOWpRC9sgo6G lQDQ== 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:dkim-signature:arc-authentication-results; bh=eJZ/fQb+z/sby1KxqgytfROibB91x+IdLHNyI9CaYTU=; b=I6ZeFy0y7DYEV2YWT733PXJCPWNAria5RHk0q/1H0f9kxoJLDrFefE9rBuT0eMSHYG fiY+D4cuV1pSlAHvqRpLdW83NnAgBLZliXqRqZCcgQbqadWkROnzWq/6+JS3fJvePjSw g1DoTQSLTEZ1mLVzqkOJ5PFDOhxdEtmvXCCyoqxVghJIjOVifKu+6UQiN0AndfmYBzCC 7e6Fj4BftLRLzTA5/afBtoNHml38GcOvQokcPBUEDLe6sWEcrPTOvRRbokNAY5Sy1G9L /V1BfZP2JWNzH2di6PivlXTEL/YdgteHyuQZkXDauF4w+kc8hFRPYEgULWr+VPXZafO3 uTWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mPHRGVAL; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c17-v6si1279408pfk.36.2018.05.15.16.58.48; Tue, 15 May 2018 16:59:02 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mPHRGVAL; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752655AbeEOX5s (ORCPT + 99 others); Tue, 15 May 2018 19:57:48 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:41703 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751402AbeEOX4d (ORCPT ); Tue, 15 May 2018 19:56:33 -0400 Received: by mail-pg0-f65.google.com with SMTP id w4-v6so735886pgq.8; Tue, 15 May 2018 16:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eJZ/fQb+z/sby1KxqgytfROibB91x+IdLHNyI9CaYTU=; b=mPHRGVALErpoLuYnDprPVhwvbe2I01cehdfJ2aP40ngBVVbmD7yd8fDxK0uw8axZFk S/goWKliWsha/v0lAdMIZSAH/M+jwpfXQ0/qmekFgqQsnsVGiE7aV21TO+xm4JdcKhpQ VGR/NJmd0RqsQzMId7SFqu5+DfHR+K98obWGWHsazRKFh7iOeMKgiAZQP1dq62VFxhxE sg0CmprdY7QbI7qxgEF+EsW1wA1rcPYMi2EvqMGYJLIerKKGg4yT/YC6P6erkUKomGtu r/17g7FusmCkshd7om/uvK0KaCVNM2M8KoChLT6XW3wSrZyexIDVA6424Gj5CYS2N04g dMaA== 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:in-reply-to :references; bh=eJZ/fQb+z/sby1KxqgytfROibB91x+IdLHNyI9CaYTU=; b=ehnOHfJwI4sMAbGEl+zk/KwQkDqPspoOz3lhh7DKfn7+JTVjQ+iNVn7eMhhmwgTen3 8eAtOqrO2hZxfI0MpKZTD91X0uMvqhxE6+zcxelR92KAvjgARL+sb/xubktTismXkGub /7JASakEPI/74nOi3d63U/Gtg3G1EcNRBNvoY6jYkWIdRyxvQ09QXeX3/UqvJrrFt8j+ Ur1oEIoVzFH7ziAucm5w9nR8ckA6E5wL3GBy+ZemkB3tI/3ss86FN2OPOzfzr2Ttr/fj 8OJcBeErGjr6PQh5INQo0dG9/edfO/iTJ9B543rU1KKfO32wGh7ckPM5Dyy6TE/4Fjl8 vS4A== X-Gm-Message-State: ALKqPweBLgg0j1Lj+be1G0OtdOxTfiIv01hLhkZZ6XmsIr9+wxNZOsab BsiLg+aJMX6ronKf6yDJqGcBNtFo X-Received: by 2002:a62:c205:: with SMTP id l5-v6mr17142658pfg.6.1526428592794; Tue, 15 May 2018 16:56:32 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id r22-v6sm1321856pfh.61.2018.05.15.16.56.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 16:56:31 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Andrew Lunn , Vivien Didelot , "David S. Miller" , Nicolas Ferre , Fugang Duan , Sergei Shtylyov , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Grygorii Strashko , Woojung Huh , Microchip Linux Driver Support , Rob Herring , Frank Rowand , Antoine Tenart , Tobias Jordan , Russell King , Geert Uytterhoeven , Thomas Petazzoni , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Simon Horman , Maxim Uvarov , Sekhar Nori , linux-kernel@vger.kernel.org (open list), linux-renesas-soc@vger.kernel.org (open list:RENESAS ETHERNET DRIVERS), linux-omap@vger.kernel.org (open list:TI ETHERNET SWITCH DRIVER (CPSW)), linux-usb@vger.kernel.org (open list:USB NETWORKING DRIVERS), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE) Subject: [PATCH net-next v2 1/2] of: mdio: Fall back to mdiobus_register() with NULL device_node Date: Tue, 15 May 2018 16:56:18 -0700 Message-Id: <20180515235619.27773-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180515235619.27773-1-f.fainelli@gmail.com> References: <20180515235619.27773-1-f.fainelli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the device_node specified is NULL, fall back to mdiobus_register(). We have a number of drivers having a similar pattern which is: if (np) of_mdiobus_register() else mdiobus_register() so incorporate that behavior within the core of_mdiobus_register() function. This is also consistent with the stub version that we defined when CONFIG_OF=n. Signed-off-by: Florian Fainelli --- drivers/of/of_mdio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 8c0c92712fc9..d963baf8e53a 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -204,6 +204,9 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) bool scanphys = false; int addr, rc; + if (!np) + return mdiobus_register(mdio); + /* Do not continue if the node is disabled */ if (!of_device_is_available(np)) return -ENODEV; -- 2.14.1