From nobody Thu Nov 28 17:53:42 2024 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A38A192D7F; Mon, 30 Sep 2024 18:00:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727719242; cv=none; b=t+Rc1ig7H19GVZcf0RM8S4dKnJBKiB9zl4i7zebeeC4cvcVGT7HpxT7o2rqDqkxUAHzIqHgoW01RWSdG7M6NcX+yGtQ1/ktQqSmVu/o/jOkiqvac2mWBEoG4qt0QYFUI9zHIKNMvR9/LghfXySz+vckoq/bLvcX8NTkhPfcsvNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727719242; c=relaxed/simple; bh=A+1j/Ugq/kUN7xpD6mKc0h/usxX2L7w7reuIgtpSPxc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YGB8/VcgiV7DdrastYhGewqRnFKYy3txNcZbz3kC2vaDyAgTIDNZk+Vs9TAgfM8S4uNQsHjQ/ddSOf/sFhOIcULnySmPQ8vmV8mkd0Prf6C+zHGrF4cXXNRDogsnm0FpT6kA4mABA1R+zpgIVEr5lfDLcPNEV6SO7/Iu5c8Zm0Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D7GUGngY; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D7GUGngY" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-71970655611so4338135b3a.0; Mon, 30 Sep 2024 11:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727719240; x=1728324040; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qIAV5bXXJI/k1ElcEpFKyJcx4VyhECZfs9bbGfC3jN4=; b=D7GUGngYWr5TI3TWUookM4AhzJ5eWXKOQtIbWSXLBNZrWJiX76GwP2HKI2EsJwZ/Js 7IrCrf+SGbAAUuzuoHVISd+5IpUjR75cCZYC8nYKIzOXnA/OdWJ32R86iTSgmgUvRoyo Ssh715kPje9QVC5y0ol7t471Ar10LWnYIVH9/nE7E+QGI8qbGgxbnKxHMg4UENbRSRWh /41R5ZjlhrUZ8PTjjiFZCDw7pX6WZIJuB6l9F4ApBySK9SsIC337471Rq523HaAjLxTB oFDF8abvTBqVzAZulkeRwQdpDk/Y7FDApBNElOELqLcaiU03Q38bHUMQ+RpfMPzm+OKT ljfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727719240; x=1728324040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qIAV5bXXJI/k1ElcEpFKyJcx4VyhECZfs9bbGfC3jN4=; b=KrFpLF9EAt4wJULnWnC+70ms6PkSWb/BjUeSwzniULwyqerhY8xX+3GUV9BJOpdk4/ kQkPhxn+MIbR/Clm3xXrXI6LMGxAkC+lMc8M4mwrbnp1j+Tza/6NqBnBqTqZu06EZCMd TS+kRZtE+dnDdcKDAh7SWPh4iz1dRS5GmkHC8AJU8nnhR53OoJZ3rE9p8tXCQZ5gwSLi fnmXFZXMHW+iY72dMUYNSHE+bwz5uzPGW7dLOc9pbqaUfyYC5u1VVyciMz6sCuJ7m7ha Cbfw4vW2Bj249m/4Owc0x9SJMAlCSKzXiw/Su40SpwFe2G8/sO5excJeL9+AV15AXU5m +YYA== X-Forwarded-Encrypted: i=1; AJvYcCWC/n0d14OA42AlvA3x3e8kV+A56xRn1wTCpF6436LokqQxAJwKIe8159UWnvPDEnQDn5E8vL2osaXft/c=@vger.kernel.org X-Gm-Message-State: AOJu0Ywxkio3Fp4igS41LaS/8EoR+hqpFhOtqnG93ZgdmD3M8WRzoOft TKJSwoXr9Y4PusCvKjm0OnG4vunqfeYemnf2Li7je62wHktj7erA4IBts4BY X-Google-Smtp-Source: AGHT+IE4PVIQLJAWQLFV88+ZXn/2GKZnbbeR5Y+OI3d508be0nsLxO2TXQuuotSG7+rnl/TSE7Ly4g== X-Received: by 2002:a05:6a00:10d5:b0:717:8deb:c195 with SMTP id d2e1a72fcca58-71b2604937emr20456095b3a.21.1727719240039; Mon, 30 Sep 2024 11:00:40 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b26524a56sm6740653b3a.149.2024.09.30.11.00.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 11:00:39 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, jacob.e.keller@intel.com, horms@kernel.org, sd@queasysnail.net, chunkeey@gmail.com Subject: [PATCH net-next 01/13] net: ibm: emac: remove custom init/exit functions Date: Mon, 30 Sep 2024 11:00:24 -0700 Message-ID: <20240930180036.87598-2-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930180036.87598-1-rosenp@gmail.com> References: <20240930180036.87598-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that we're using EPROBE_DEFER, we don't have to do custom initialization and we can let the core handle this for us. Signed-off-by: Rosen Penev --- drivers/net/ethernet/ibm/emac/core.c | 39 +-------------------------- drivers/net/ethernet/ibm/emac/mal.h | 4 --- drivers/net/ethernet/ibm/emac/rgmii.h | 4 --- drivers/net/ethernet/ibm/emac/tah.h | 4 --- drivers/net/ethernet/ibm/emac/zmii.h | 4 --- 5 files changed, 1 insertion(+), 54 deletions(-) diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ib= m/emac/core.c index d476844bae3e..97ae0b7ccb0d 100644 --- a/drivers/net/ethernet/ibm/emac/core.c +++ b/drivers/net/ethernet/ibm/emac/core.c @@ -3283,42 +3283,10 @@ static void __init emac_make_bootlist(void) =20 static int __init emac_init(void) { - int rc; - - printk(KERN_INFO DRV_DESC ", version " DRV_VERSION "\n"); - /* Build EMAC boot list */ emac_make_bootlist(); =20 - /* Init submodules */ - rc =3D mal_init(); - if (rc) - goto err; - rc =3D zmii_init(); - if (rc) - goto err_mal; - rc =3D rgmii_init(); - if (rc) - goto err_zmii; - rc =3D tah_init(); - if (rc) - goto err_rgmii; - rc =3D platform_driver_register(&emac_driver); - if (rc) - goto err_tah; - - return 0; - - err_tah: - tah_exit(); - err_rgmii: - rgmii_exit(); - err_zmii: - zmii_exit(); - err_mal: - mal_exit(); - err: - return rc; + return platform_driver_register(&emac_driver); } =20 static void __exit emac_exit(void) @@ -3327,11 +3295,6 @@ static void __exit emac_exit(void) =20 platform_driver_unregister(&emac_driver); =20 - tah_exit(); - rgmii_exit(); - zmii_exit(); - mal_exit(); - /* Destroy EMAC boot list */ for (i =3D 0; i < EMAC_BOOT_LIST_SIZE; i++) of_node_put(emac_boot_list[i]); diff --git a/drivers/net/ethernet/ibm/emac/mal.h b/drivers/net/ethernet/ibm= /emac/mal.h index e0ddc41186a2..2963b36be6f5 100644 --- a/drivers/net/ethernet/ibm/emac/mal.h +++ b/drivers/net/ethernet/ibm/emac/mal.h @@ -252,10 +252,6 @@ static inline int mal_has_feature(struct mal_instance = *dev, (MAL_FTRS_POSSIBLE & dev->features & feature); } =20 -/* Register MAL devices */ -int mal_init(void); -void mal_exit(void); - int mal_register_commac(struct mal_instance *mal, struct mal_commac *commac); void mal_unregister_commac(struct mal_instance *mal, diff --git a/drivers/net/ethernet/ibm/emac/rgmii.h b/drivers/net/ethernet/i= bm/emac/rgmii.h index 8e4e36eed172..170bcd35039b 100644 --- a/drivers/net/ethernet/ibm/emac/rgmii.h +++ b/drivers/net/ethernet/ibm/emac/rgmii.h @@ -52,8 +52,6 @@ struct rgmii_instance { =20 #ifdef CONFIG_IBM_EMAC_RGMII =20 -int rgmii_init(void); -void rgmii_exit(void); int rgmii_attach(struct platform_device *ofdev, int input, int mode); void rgmii_detach(struct platform_device *ofdev, int input); void rgmii_get_mdio(struct platform_device *ofdev, int input); @@ -64,8 +62,6 @@ void *rgmii_dump_regs(struct platform_device *ofdev, void= *buf); =20 #else =20 -# define rgmii_init() 0 -# define rgmii_exit() do { } while(0) # define rgmii_attach(x,y,z) (-ENXIO) # define rgmii_detach(x,y) do { } while(0) # define rgmii_get_mdio(o,i) do { } while (0) diff --git a/drivers/net/ethernet/ibm/emac/tah.h b/drivers/net/ethernet/ibm= /emac/tah.h index 86c2b6b9d460..60c16cf7a41a 100644 --- a/drivers/net/ethernet/ibm/emac/tah.h +++ b/drivers/net/ethernet/ibm/emac/tah.h @@ -68,8 +68,6 @@ struct tah_instance { =20 #ifdef CONFIG_IBM_EMAC_TAH =20 -int tah_init(void); -void tah_exit(void); int tah_attach(struct platform_device *ofdev, int channel); void tah_detach(struct platform_device *ofdev, int channel); void tah_reset(struct platform_device *ofdev); @@ -78,8 +76,6 @@ void *tah_dump_regs(struct platform_device *ofdev, void *= buf); =20 #else =20 -# define tah_init() 0 -# define tah_exit() do { } while(0) # define tah_attach(x,y) (-ENXIO) # define tah_detach(x,y) do { } while(0) # define tah_reset(x) do { } while(0) diff --git a/drivers/net/ethernet/ibm/emac/zmii.h b/drivers/net/ethernet/ib= m/emac/zmii.h index 65daedc78594..213de06d8ea2 100644 --- a/drivers/net/ethernet/ibm/emac/zmii.h +++ b/drivers/net/ethernet/ibm/emac/zmii.h @@ -48,8 +48,6 @@ struct zmii_instance { =20 #ifdef CONFIG_IBM_EMAC_ZMII =20 -int zmii_init(void); -void zmii_exit(void); int zmii_attach(struct platform_device *ofdev, int input, phy_interface_t *mode); void zmii_detach(struct platform_device *ofdev, int input); @@ -60,8 +58,6 @@ int zmii_get_regs_len(struct platform_device *ocpdev); void *zmii_dump_regs(struct platform_device *ofdev, void *buf); =20 #else -# define zmii_init() 0 -# define zmii_exit() do { } while(0) # define zmii_attach(x,y,z) (-ENXIO) # define zmii_detach(x,y) do { } while(0) # define zmii_get_mdio(x,y) do { } while(0) --=20 2.46.2