Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp639587pxv; Thu, 15 Jul 2021 12:11:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlJD2Y/IqxqgG/9/HwXBhYTyphol1O06uNYNW7UpMOqnZgr6Nk7iiCvAwY6jBAaBlTTKa/ X-Received: by 2002:aa7:d809:: with SMTP id v9mr9279448edq.146.1626376282168; Thu, 15 Jul 2021 12:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376282; cv=none; d=google.com; s=arc-20160816; b=fvY4pMnbgQTgEDyQ5HmObSe8BM4tdW4uHUSIWf1sf6NG/XVvINC9E484iK+5ImAUwf hSvpXfau3Vs0OQKWm6pacA75A55rz9l1HbUp5REPJ+AP4l0hjJGOAqnvDbNmzelgLI7E Lqfr4jb5mY62RN10YqzHx3UwqhsKTWE0zJAXpmQcDwx1+dET1ytzlZ4LUgEBjdbaSjSH /Kkjr7Nv4ECnUU29FOP9ivnX4No/2mBaUyF96RVeRY6jVUFpH5o4sgo4HVIaDruEZygG Opo9702hHpL9EcFUm0iI/SUTLAufzNcckXh7SmB6Bh3bpaWXXb6O+dWfE2TmprMz6xtJ VjCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+O2+vEiUbAucOuey5kdWZ0dYr46XG7QvZuu4zIyAQrU=; b=nR8squIezZFzG0lycqGDHoy8QL/RbPujNPiIn3AqFH5hEjoE7Abh9ttUBrmoagrGOK MRDpt/4YK+uoXekUrO4CNhqEssE4oIvzcmOC7iHkramv2BCXDOaZ36NR2vKzMy7l0iVO NdGHKq1Fy4Az8WhlQCyq+4102WhTFqQISqvHlafgxFKjurJ9Isff7F4OCFhQOqhJURiR qo/rrKuK5i1USJMB9FWuDyHWuAD3cLCiiTJZ0IwxznobMFNdjUgShJHGJ3K/vOuHfyLQ /hXGsPb6IRdnJVry6/OSTBRy1WJVCtTVPMSklfbaRuY/j9Egkx9NkmrcLJvr5HCTkYq1 etgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VPKBG7pw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di1si7156056ejc.420.2021.07.15.12.10.59; Thu, 15 Jul 2021 12:11:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VPKBG7pw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242370AbhGOTI6 (ORCPT + 99 others); Thu, 15 Jul 2021 15:08:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:35148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241536AbhGOS5z (ORCPT ); Thu, 15 Jul 2021 14:57:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 07FC8613D1; Thu, 15 Jul 2021 18:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375301; bh=d09ir3kgb9xtU564t4rO0NluCjTTcHfF8TAcNZAL3Ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VPKBG7pwFQtoy7MEuA7otREsKLg/0G2ZVwu5dswSrr+nqwqVnhvXar6hKwQ50LVtj CCdXj1zLgAgjGEQ8WRjBEroOJZlojLsCEX0c9laofkg8XtWD0we3qioI9TzVsnwAiv B7yH3xGuJbGA1ulhKe0QXXUwjmKmZx7gAoUdAZ9s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Vladimir Oltean , Andrew Lunn , Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 5.12 022/242] net: mdio: provide shim implementation of devm_of_mdiobus_register Date: Thu, 15 Jul 2021 20:36:24 +0200 Message-Id: <20210715182555.669787927@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Oltean [ Upstream commit 86544c3de6a2185409c5a3d02f674ea223a14217 ] Similar to the way in which of_mdiobus_register() has a fallback to the non-DT based mdiobus_register() when CONFIG_OF is not set, we can create a shim for the device-managed devm_of_mdiobus_register() which calls devm_mdiobus_register() and discards the struct device_node *. In particular, this solves a build issue with the qca8k DSA driver which uses devm_of_mdiobus_register and can be compiled without CONFIG_OF. Reported-by: Randy Dunlap Signed-off-by: Vladimir Oltean Acked-by: Randy Dunlap # build-tested Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/linux/of_mdio.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index 2b05e7f7c238..da633d34ab86 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h @@ -72,6 +72,13 @@ static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node * return mdiobus_register(mdio); } +static inline int devm_of_mdiobus_register(struct device *dev, + struct mii_bus *mdio, + struct device_node *np) +{ + return devm_mdiobus_register(dev, mdio); +} + static inline struct mdio_device *of_mdio_find_device(struct device_node *np) { return NULL; -- 2.30.2