Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2609585ybt; Mon, 22 Jun 2020 02:45:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycKfEIxT0jn0oXGwqpI8RfLFdK7H/W24Ebk+oHr6MXsfg0xWSLF0EVtbVJZ1cyt822eIbA X-Received: by 2002:aa7:d9c6:: with SMTP id v6mr16136617eds.29.1592819125761; Mon, 22 Jun 2020 02:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592819125; cv=none; d=google.com; s=arc-20160816; b=t88LEK8kQqzHkcL6+ovQm7D+HGdmOv0YpZA8xMT3JjTqci7wvEYADLMG1UiKhPUdDw Y3HWNJRhErTxV+eXlfzRqehPcVq+9pYE2QfoZfo30J1DHKzXrAX95Acc60yPF/AZHifd HCQabnN3MTKP0GWdjsBotcyNtz5+9GMMeErKzXAcdcioWoaw/f41vBMN/HbH0k+fd6+3 u7VvER8ZH7ePclSa3n4z0gbujOgQp5zM/T45o/hyLwxarrXaSgyr+ZYs12yQHfUA7gjn k5XsESH3knKLUYZdDUqBwZwVVgKkk1PqfyuGIwBh+XHJsLyDhd8rmfAa3yRlfawtos8q yjKg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r7nW5+M2kh3cyRyjmx7rE7/COR4QWlNL8CdVe/fIbIs=; b=h9Coto7J+/SMot39NpqksIyn0I6ilsDW52ohQp5Gos7PSgR8l6MO0mwG5ADtV2Hu0h 6/LazKbgto8mTM5ZQa8k6d2wRblF6vsgd9k08aY46acJXy+0PncQMWAHMliykPYCM45F sfKBBvHBSFjSJjwgzDJ+IUMp56NDLCHLGLaFR5eiG7KogHjWcpTrq761uEMtN7kdH+Zx NLxalaQE+gNexkOOOx9POLzDZBEvcb+ZLFRupK7tkKraTjGzjgrcTUxJRXPXR5foKf3u 58tZcCNGgd5r9n6KzvQOPEB9wRMVhWQHtZS/sSFtHavRfHmRiYg227Ps8eQ5YuFfEezd sEqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=XpSDFkYe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si8858396edw.591.2020.06.22.02.45.03; Mon, 22 Jun 2020 02:45:25 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=XpSDFkYe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727929AbgFVJmg (ORCPT + 99 others); Mon, 22 Jun 2020 05:42:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbgFVJlm (ORCPT ); Mon, 22 Jun 2020 05:41:42 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2209FC06179A for ; Mon, 22 Jun 2020 02:41:41 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id q2so13511312wrv.8 for ; Mon, 22 Jun 2020 02:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r7nW5+M2kh3cyRyjmx7rE7/COR4QWlNL8CdVe/fIbIs=; b=XpSDFkYeVraxiwg/39otpkkJoHtYP4sFAfXMCtKdQJw1oTQbFoKREJWtbqNON3jfWc EGdzjWhRvetEZZlr/I5j+Y99sKov/il4jFxNvZDmEZqLsj05w9DscD2q2xxItOV7NEn0 Ks0NxdCoBxv9IqVnzDoXUtuX3V4Tmr4PdQyGyVC2ZsCreOyID+ag5NQdk+BuXbrM9LaI BGdjyyH7GCr2qq1OPt17TJtEH06ciHZSyAqQx0XLoZ5bSNK1Mi5eNtUeINHTvTKl8gSE eNqCc3eEQOEUxA3S0GBF2Mfp+PTfRWQbgIYVM7JWIsVaP5PiUOxf3ffTQdRFjltEHbpn c0vQ== 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:mime-version:content-transfer-encoding; bh=r7nW5+M2kh3cyRyjmx7rE7/COR4QWlNL8CdVe/fIbIs=; b=YsmF4tcwAlojALmi9EokyXOsvBqFnV5mZGzOLb7wq9Ds/pWleWQdVG/KqUPy0odYtG Y5228dgXIECfz0EMA00JWKCwpi8dn+agvkIa9Tv+7WVDkhZVQaRiBxx3Tck6FoGOdOVP GQ+Pc+ROZnbLZzMTHFQDKZw0YDFgfzvuionbwoM9Q/TfAZgcjOcuIOCXKPgOCTskS6hE SwrzSx3D0wwIAiwLVsc3C9hzYry49YVhyyuCZni7vt+eLxrQv5nketVgtl2wXuoHlbbV nI+Uljaj6Tl4k8HxVhp/RnAfZLS8h1JzQkqWNhh+MMyM3Bx6CFo4fGKxU/Ux+TYTcnkH iUpw== X-Gm-Message-State: AOAM532rvt2bpscZUCSZrP6YK514K+/caCUu8GfKb5VEKI5eGQNAlTXG ryyW3cpUkuU1a/B50JbRCw5PuQ== X-Received: by 2002:adf:a34d:: with SMTP id d13mr17477047wrb.270.1592818899871; Mon, 22 Jun 2020 02:41:39 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:39 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Fabien Parent , Stephane Le Provost , Pedro Tsai , Andrew Perepech , Bartosz Golaszewski Subject: [PATCH 10/15] net: phy: simplify phy_device_create() Date: Mon, 22 Jun 2020 11:37:39 +0200 Message-Id: <20200622093744.13685-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski The last argument passed to phy_device_create() (c45_ids) is never used in current mainline outside of the core PHY code - it can only be configured when reading the PHY ID from phy_device_read_id(). Let's drop this argument treewide. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/nxp-tja11xx.c | 2 +- drivers/net/phy/phy_device.c | 8 +++----- drivers/of/of_mdio.c | 2 +- include/linux/phy.h | 3 +-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c index a72fa0d2e7c7..b98b620ef88c 100644 --- a/drivers/net/phy/nxp-tja11xx.c +++ b/drivers/net/phy/nxp-tja11xx.c @@ -507,7 +507,7 @@ static void tja1102_p1_register(struct work_struct *work) } /* Real PHY ID of Port 1 is 0 */ - phy = phy_device_create(bus, addr, PHY_ID_TJA1102, false, NULL); + phy = phy_device_create(bus, addr, PHY_ID_TJA1102, false); if (IS_ERR(phy)) { dev_err(dev, "Can't create PHY device for Port 1: %i\n", addr); diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 94944fffa9bb..ad7c4cd9d357 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -613,8 +613,7 @@ static int phy_request_driver_module(struct phy_device *phydev) } struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, - bool is_c45, - struct phy_c45_device_ids *c45_ids) + bool is_c45) { struct phy_device *dev; struct mdio_device *mdiodev; @@ -647,8 +646,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, dev->is_c45 = is_c45; dev->phy_id = phy_id; - if (c45_ids) - dev->c45_ids = *c45_ids; + dev->irq = bus->irq[addr]; dev_set_name(&mdiodev->dev, PHY_ID_FMT, bus->id, addr); @@ -829,7 +827,7 @@ static int phy_device_read_id(struct phy_device *phydev) */ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) { - return phy_device_create(bus, addr, PHY_ID_NONE, is_c45, NULL); + return phy_device_create(bus, addr, PHY_ID_NONE, is_c45); } EXPORT_SYMBOL(get_phy_device); diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index a04afe79529c..63843037673c 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -121,7 +121,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, "ethernet-phy-ieee802.3-c45"); if (!is_c45 && !of_get_phy_id(child, &phy_id)) - phy = phy_device_create(mdio, addr, phy_id, 0, NULL); + phy = phy_device_create(mdio, addr, phy_id, 0); else phy = get_phy_device(mdio, addr, is_c45); if (IS_ERR(phy)) { diff --git a/include/linux/phy.h b/include/linux/phy.h index 2a695cd90c7c..662919c1dd27 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1213,8 +1213,7 @@ int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum, u16 mask, u16 set); struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, - bool is_c45, - struct phy_c45_device_ids *c45_ids); + bool is_c45); #if IS_ENABLED(CONFIG_PHYLIB) struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); int phy_device_register(struct phy_device *phy); -- 2.26.1