All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the akpm tree with the net tree
@ 2012-06-12  4:07 ` Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2012-06-12  4:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-next, linux-kernel, Giuseppe CAVALLARO, David Miller,
	netdev, Viresh Kumar

[-- Attachment #1: Type: text/plain, Size: 3125 bytes --]

Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
drivers/net/ethernet/stmicro/stmmac/stmmac.h between commit 33d5e332b9c5
("stmmac: fix driver built w/ w/o both pci and platf modules") from the
net tree and commit "net/stmmac: remove conditional compilation of clk
code" from the akpm tree.

Just context changes.  I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 94b21b4,8e1a43b..0000000
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@@ -104,99 -103,3 +102,59 @@@ int stmmac_dvr_remove(struct net_devic
  struct stmmac_priv *stmmac_dvr_probe(struct device *device,
  				     struct plat_stmmacenet_data *plat_dat,
  				     void __iomem *addr);
 +
- #ifdef CONFIG_HAVE_CLK
- static inline int stmmac_clk_enable(struct stmmac_priv *priv)
- {
- 	if (!IS_ERR(priv->stmmac_clk))
- 		return clk_enable(priv->stmmac_clk);
- 
- 	return 0;
- }
- 
- static inline void stmmac_clk_disable(struct stmmac_priv *priv)
- {
- 	if (IS_ERR(priv->stmmac_clk))
- 		return;
- 
- 	clk_disable(priv->stmmac_clk);
- }
- static inline int stmmac_clk_get(struct stmmac_priv *priv)
- {
- 	priv->stmmac_clk = clk_get(priv->device, NULL);
- 
- 	if (IS_ERR(priv->stmmac_clk))
- 		return PTR_ERR(priv->stmmac_clk);
- 
- 	return 0;
- }
- #else
- static inline int stmmac_clk_enable(struct stmmac_priv *priv)
- {
- 	return 0;
- }
- static inline void stmmac_clk_disable(struct stmmac_priv *priv)
- {
- }
- static inline int stmmac_clk_get(struct stmmac_priv *priv)
- {
- 	return 0;
- }
- #endif /* CONFIG_HAVE_CLK */
- 
- 
 +#ifdef CONFIG_STMMAC_PLATFORM
 +extern struct platform_driver stmmac_pltfr_driver;
 +static inline int stmmac_register_platform(void)
 +{
 +	int err;
 +
 +	err = platform_driver_register(&stmmac_pltfr_driver);
 +	if (err)
 +		pr_err("stmmac: failed to register the platform driver\n");
 +
 +	return err;
 +}
 +static inline void stmmac_unregister_platform(void)
 +{
 +	platform_driver_register(&stmmac_pltfr_driver);
 +}
 +#else
 +static inline int stmmac_register_platform(void)
 +{
 +	pr_debug("stmmac: do not register the platf driver\n");
 +
 +	return -EINVAL;
 +}
 +static inline void stmmac_unregister_platform(void)
 +{
 +}
 +#endif /* CONFIG_STMMAC_PLATFORM */
 +
 +#ifdef CONFIG_STMMAC_PCI
 +extern struct pci_driver stmmac_pci_driver;
 +static inline int stmmac_register_pci(void)
 +{
 +	int err;
 +
 +	err = pci_register_driver(&stmmac_pci_driver);
 +	if (err)
 +		pr_err("stmmac: failed to register the PCI driver\n");
 +
 +	return err;
 +}
 +static inline void stmmac_unregister_pci(void)
 +{
 +	pci_unregister_driver(&stmmac_pci_driver);
 +}
 +#else
 +static inline int stmmac_register_pci(void)
 +{
 +	pr_debug("stmmac: do not register the PCI driver\n");
 +
 +	return -EINVAL;
 +}
 +static inline void stmmac_unregister_pci(void)
 +{
 +}
 +#endif /* CONFIG_STMMAC_PCI */

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the akpm tree with the net tree
@ 2012-06-12  4:07 ` Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2012-06-12  4:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-next, linux-kernel, Giuseppe CAVALLARO, David Miller,
	netdev, Viresh Kumar

[-- Attachment #1: Type: text/plain, Size: 3125 bytes --]

Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
drivers/net/ethernet/stmicro/stmmac/stmmac.h between commit 33d5e332b9c5
("stmmac: fix driver built w/ w/o both pci and platf modules") from the
net tree and commit "net/stmmac: remove conditional compilation of clk
code" from the akpm tree.

Just context changes.  I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 94b21b4,8e1a43b..0000000
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@@ -104,99 -103,3 +102,59 @@@ int stmmac_dvr_remove(struct net_devic
  struct stmmac_priv *stmmac_dvr_probe(struct device *device,
  				     struct plat_stmmacenet_data *plat_dat,
  				     void __iomem *addr);
 +
- #ifdef CONFIG_HAVE_CLK
- static inline int stmmac_clk_enable(struct stmmac_priv *priv)
- {
- 	if (!IS_ERR(priv->stmmac_clk))
- 		return clk_enable(priv->stmmac_clk);
- 
- 	return 0;
- }
- 
- static inline void stmmac_clk_disable(struct stmmac_priv *priv)
- {
- 	if (IS_ERR(priv->stmmac_clk))
- 		return;
- 
- 	clk_disable(priv->stmmac_clk);
- }
- static inline int stmmac_clk_get(struct stmmac_priv *priv)
- {
- 	priv->stmmac_clk = clk_get(priv->device, NULL);
- 
- 	if (IS_ERR(priv->stmmac_clk))
- 		return PTR_ERR(priv->stmmac_clk);
- 
- 	return 0;
- }
- #else
- static inline int stmmac_clk_enable(struct stmmac_priv *priv)
- {
- 	return 0;
- }
- static inline void stmmac_clk_disable(struct stmmac_priv *priv)
- {
- }
- static inline int stmmac_clk_get(struct stmmac_priv *priv)
- {
- 	return 0;
- }
- #endif /* CONFIG_HAVE_CLK */
- 
- 
 +#ifdef CONFIG_STMMAC_PLATFORM
 +extern struct platform_driver stmmac_pltfr_driver;
 +static inline int stmmac_register_platform(void)
 +{
 +	int err;
 +
 +	err = platform_driver_register(&stmmac_pltfr_driver);
 +	if (err)
 +		pr_err("stmmac: failed to register the platform driver\n");
 +
 +	return err;
 +}
 +static inline void stmmac_unregister_platform(void)
 +{
 +	platform_driver_register(&stmmac_pltfr_driver);
 +}
 +#else
 +static inline int stmmac_register_platform(void)
 +{
 +	pr_debug("stmmac: do not register the platf driver\n");
 +
 +	return -EINVAL;
 +}
 +static inline void stmmac_unregister_platform(void)
 +{
 +}
 +#endif /* CONFIG_STMMAC_PLATFORM */
 +
 +#ifdef CONFIG_STMMAC_PCI
 +extern struct pci_driver stmmac_pci_driver;
 +static inline int stmmac_register_pci(void)
 +{
 +	int err;
 +
 +	err = pci_register_driver(&stmmac_pci_driver);
 +	if (err)
 +		pr_err("stmmac: failed to register the PCI driver\n");
 +
 +	return err;
 +}
 +static inline void stmmac_unregister_pci(void)
 +{
 +	pci_unregister_driver(&stmmac_pci_driver);
 +}
 +#else
 +static inline int stmmac_register_pci(void)
 +{
 +	pr_debug("stmmac: do not register the PCI driver\n");
 +
 +	return -EINVAL;
 +}
 +static inline void stmmac_unregister_pci(void)
 +{
 +}
 +#endif /* CONFIG_STMMAC_PCI */

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the akpm tree with the net tree
@ 2019-06-26 12:02 Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2019-06-26 12:02 UTC (permalink / raw)
  To: Andrew Morton, David Miller, Networking
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Eiichi Tsukata, Matteo Croce

[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]

Hi all,

Today's linux-next merge of the akpm tree got a conflict in:

  net/ipv6/route.c

between commit:

  b8e8a86337c2 ("net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down"")

from the net tree and patch:

  "proc/sysctl: add shared variables for range check"

from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/ipv6/route.c
index a0994415484e,c5125cdff32c..000000000000
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@@ -6077,9 -6074,9 +6074,9 @@@ static struct ctl_table ipv6_route_tabl
  		.data		=	&init_net.ipv6.sysctl.skip_notify_on_dev_down,
  		.maxlen		=	sizeof(int),
  		.mode		=	0644,
 -		.proc_handler	=	proc_dointvec,
 +		.proc_handler	=	proc_dointvec_minmax,
- 		.extra1		=	&zero,
- 		.extra2		=	&one,
+ 		.extra1		=	SYSCTL_ZERO,
+ 		.extra2		=	SYSCTL_ONE,
  	},
  	{ }
  };

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the akpm tree with the net tree
@ 2017-02-10  7:27 Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2017-02-10  7:27 UTC (permalink / raw)
  To: Andrew Morton, David Miller, Networking
  Cc: linux-next, linux-kernel, Alexey Dobriyan, Stefan Brüns

Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

  drivers/net/usb/sierra_net.c

between commit:

  5a70348e1187 ("sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications")

from the net tree and patch:

  "lib/vsprintf.c: remove %Z support"

from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/usb/sierra_net.c
index d9440bc022f2,88ace5024306..000000000000
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@@ -376,11 -349,11 +376,11 @@@ static inline int sierra_net_is_valid_a
  static int sierra_net_parse_lsi(struct usbnet *dev, char *data, int datalen)
  {
  	struct lsi_umts *lsi = (struct lsi_umts *)data;
 +	u32 expected_length;
  
 -	if (datalen < sizeof(struct lsi_umts)) {
 -		netdev_err(dev->net, "%s: Data length %d, exp %zu\n",
 -				__func__, datalen,
 -				sizeof(struct lsi_umts));
 +	if (datalen < sizeof(struct lsi_umts_single)) {
- 		netdev_err(dev->net, "%s: Data length %d, exp >= %Zu\n",
++		netdev_err(dev->net, "%s: Data length %d, exp >= %zu\n",
 +			   __func__, datalen, sizeof(struct lsi_umts_single));
  		return -1;
  	}
  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the akpm tree with the net tree
@ 2016-10-14  2:12 Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2016-10-14  2:12 UTC (permalink / raw)
  To: Andrew Morton, David Miller, Networking
  Cc: linux-next, linux-kernel, Tom Herbert, Saeed Mahameed

Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

  include/linux/mlx5/device.h

between commit:

  b8a4ddb2e8f4 ("net/mlx5: Add MLX5_ARRAY_SET64 to fix BUILD_BUG_ON")

from the net tree and patch:

  "include/linux/mlx5/device.h: kill BUILD_BUG_ON()s"

from the akpm tree.

I fixed it up (I just dropped the akpm tree patch for today) and can
carry the fix as necessary. This is now fixed as far as linux-next is
concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the akpm tree with the net tree
@ 2012-06-13  5:27 ` Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2012-06-13  5:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-next, linux-kernel, Stefan Roese, David Miller, netdev,
	Viresh Kumar

[-- Attachment #1: Type: text/plain, Size: 5541 bytes --]

Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
drivers/net/ethernet/stmicro/stmmac/stmmac.h between commit 883ffd6e6411
("net: stmmac: Fix clock en-/disable calls") from the net tree and commit
"net/stmmac: remove conditional compilation of clk code" from the akpm
tree.

I fixed it up (I think - see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index dc20c56..900c5e6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -82,9 +82,7 @@ struct stmmac_priv {
 	struct stmmac_counters mmc;
 	struct dma_features dma_cap;
 	int hw_cap_support;
-#ifdef CONFIG_HAVE_CLK
 	struct clk *stmmac_clk;
-#endif
 	int clk_csr;
 	int synopsys_id;
 };
@@ -105,46 +103,6 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 				     struct plat_stmmacenet_data *plat_dat,
 				     void __iomem *addr);
 
-#ifdef CONFIG_HAVE_CLK
-static inline int stmmac_clk_enable(struct stmmac_priv *priv)
-{
-	if (!IS_ERR(priv->stmmac_clk))
-		return clk_prepare_enable(priv->stmmac_clk);
-
-	return 0;
-}
-
-static inline void stmmac_clk_disable(struct stmmac_priv *priv)
-{
-	if (IS_ERR(priv->stmmac_clk))
-		return;
-
-	clk_disable_unprepare(priv->stmmac_clk);
-}
-static inline int stmmac_clk_get(struct stmmac_priv *priv)
-{
-	priv->stmmac_clk = clk_get(priv->device, NULL);
-
-	if (IS_ERR(priv->stmmac_clk))
-		return PTR_ERR(priv->stmmac_clk);
-
-	return 0;
-}
-#else
-static inline int stmmac_clk_enable(struct stmmac_priv *priv)
-{
-	return 0;
-}
-static inline void stmmac_clk_disable(struct stmmac_priv *priv)
-{
-}
-static inline int stmmac_clk_get(struct stmmac_priv *priv)
-{
-	return 0;
-}
-#endif /* CONFIG_HAVE_CLK */
-
-
 #ifdef CONFIG_STMMAC_PLATFORM
 extern struct platform_driver stmmac_pltfr_driver;
 static inline int stmmac_register_platform(void)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 590e95b..bb63678 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -28,6 +28,7 @@
 	https://bugzilla.stlinux.com/
 *******************************************************************************/
 
+#include <linux/clk.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/ip.h>
@@ -165,12 +166,8 @@ static void stmmac_verify_args(void)
 
 static void stmmac_clk_csr_set(struct stmmac_priv *priv)
 {
-#ifdef CONFIG_HAVE_CLK
 	u32 clk_rate;
 
-	if (IS_ERR(priv->stmmac_clk))
-		return;
-
 	clk_rate = clk_get_rate(priv->stmmac_clk);
 
 	/* Platform provided default clk_csr would be assumed valid
@@ -192,7 +189,6 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv)
 	   * we can not estimate the proper divider as it is not known
 	   * the frequency of clk_csr_i. So we do not change the default
 	   * divider. */
-#endif
 }
 
 #if defined(STMMAC_XMIT_DEBUG) || defined(STMMAC_RX_DEBUG)
@@ -974,7 +970,7 @@ static int stmmac_open(struct net_device *dev)
 	} else
 		priv->tm->enable = 1;
 #endif
-	stmmac_clk_enable(priv);
+	clk_prepare_enable(priv->stmmac_clk);
 
 	stmmac_check_ether_addr(priv);
 
@@ -1078,7 +1074,7 @@ open_error:
 	if (priv->phydev)
 		phy_disconnect(priv->phydev);
 
-	stmmac_clk_disable(priv);
+	clk_disable_unprepare(priv->stmmac_clk);
 
 	return ret;
 }
@@ -1131,7 +1127,7 @@ static int stmmac_release(struct net_device *dev)
 #ifdef CONFIG_STMMAC_DEBUG_FS
 	stmmac_exit_fs();
 #endif
-	stmmac_clk_disable(priv);
+	clk_disable_unprepare(priv->stmmac_clk);
 
 	return 0;
 }
@@ -1926,11 +1922,14 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 	ret = register_netdev(ndev);
 	if (ret) {
 		pr_err("%s: ERROR %i registering the device\n", __func__, ret);
-		goto error;
+		goto error_netdev_register;
 	}
 
-	if (stmmac_clk_get(priv))
+	priv->stmmac_clk = clk_get(priv->device, NULL);
+	if (IS_ERR(priv->stmmac_clk)) {
 		pr_warning("%s: warning: cannot get CSR clock\n", __func__);
+		goto error_clk_get;
+	}
 
 	/* If a specific clk_csr value is passed from the platform
 	 * this means that the CSR Clock Range selection cannot be
@@ -1948,15 +1947,17 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 	if (ret < 0) {
 		pr_debug("%s: MDIO bus (id: %d) registration failed",
 			 __func__, priv->plat->bus_id);
-		goto error;
+		goto error_mdio_register;
 	}
 
 	return priv;
 
-error:
-	netif_napi_del(&priv->napi);
-
+error_mdio_register:
+	clk_put(priv->stmmac_clk);
+error_clk_get:
 	unregister_netdev(ndev);
+error_netdev_register:
+	netif_napi_del(&priv->napi);
 	free_netdev(ndev);
 
 	return NULL;
@@ -2025,7 +2026,7 @@ int stmmac_suspend(struct net_device *ndev)
 	else {
 		stmmac_set_mac(priv->ioaddr, false);
 		/* Disable clock in case of PWM is off */
-		stmmac_clk_disable(priv);
+		clk_disable_unprepare(priv->stmmac_clk);
 	}
 	spin_unlock_irqrestore(&priv->lock, flags);
 	return 0;
@@ -2050,7 +2051,7 @@ int stmmac_resume(struct net_device *ndev)
 		priv->hw->mac->pmt(priv->ioaddr, 0);
 	else
 		/* enable the clk prevously disabled */
-		stmmac_clk_enable(priv);
+		clk_prepare_enable(priv->stmmac_clk);
 
 	netif_device_attach(ndev);
 

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the akpm tree with the net tree
@ 2012-06-13  5:27 ` Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2012-06-13  5:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-next, linux-kernel, Stefan Roese, David Miller, netdev,
	Viresh Kumar

[-- Attachment #1: Type: text/plain, Size: 5541 bytes --]

Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
drivers/net/ethernet/stmicro/stmmac/stmmac.h between commit 883ffd6e6411
("net: stmmac: Fix clock en-/disable calls") from the net tree and commit
"net/stmmac: remove conditional compilation of clk code" from the akpm
tree.

I fixed it up (I think - see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index dc20c56..900c5e6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -82,9 +82,7 @@ struct stmmac_priv {
 	struct stmmac_counters mmc;
 	struct dma_features dma_cap;
 	int hw_cap_support;
-#ifdef CONFIG_HAVE_CLK
 	struct clk *stmmac_clk;
-#endif
 	int clk_csr;
 	int synopsys_id;
 };
@@ -105,46 +103,6 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 				     struct plat_stmmacenet_data *plat_dat,
 				     void __iomem *addr);
 
-#ifdef CONFIG_HAVE_CLK
-static inline int stmmac_clk_enable(struct stmmac_priv *priv)
-{
-	if (!IS_ERR(priv->stmmac_clk))
-		return clk_prepare_enable(priv->stmmac_clk);
-
-	return 0;
-}
-
-static inline void stmmac_clk_disable(struct stmmac_priv *priv)
-{
-	if (IS_ERR(priv->stmmac_clk))
-		return;
-
-	clk_disable_unprepare(priv->stmmac_clk);
-}
-static inline int stmmac_clk_get(struct stmmac_priv *priv)
-{
-	priv->stmmac_clk = clk_get(priv->device, NULL);
-
-	if (IS_ERR(priv->stmmac_clk))
-		return PTR_ERR(priv->stmmac_clk);
-
-	return 0;
-}
-#else
-static inline int stmmac_clk_enable(struct stmmac_priv *priv)
-{
-	return 0;
-}
-static inline void stmmac_clk_disable(struct stmmac_priv *priv)
-{
-}
-static inline int stmmac_clk_get(struct stmmac_priv *priv)
-{
-	return 0;
-}
-#endif /* CONFIG_HAVE_CLK */
-
-
 #ifdef CONFIG_STMMAC_PLATFORM
 extern struct platform_driver stmmac_pltfr_driver;
 static inline int stmmac_register_platform(void)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 590e95b..bb63678 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -28,6 +28,7 @@
 	https://bugzilla.stlinux.com/
 *******************************************************************************/
 
+#include <linux/clk.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/ip.h>
@@ -165,12 +166,8 @@ static void stmmac_verify_args(void)
 
 static void stmmac_clk_csr_set(struct stmmac_priv *priv)
 {
-#ifdef CONFIG_HAVE_CLK
 	u32 clk_rate;
 
-	if (IS_ERR(priv->stmmac_clk))
-		return;
-
 	clk_rate = clk_get_rate(priv->stmmac_clk);
 
 	/* Platform provided default clk_csr would be assumed valid
@@ -192,7 +189,6 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv)
 	   * we can not estimate the proper divider as it is not known
 	   * the frequency of clk_csr_i. So we do not change the default
 	   * divider. */
-#endif
 }
 
 #if defined(STMMAC_XMIT_DEBUG) || defined(STMMAC_RX_DEBUG)
@@ -974,7 +970,7 @@ static int stmmac_open(struct net_device *dev)
 	} else
 		priv->tm->enable = 1;
 #endif
-	stmmac_clk_enable(priv);
+	clk_prepare_enable(priv->stmmac_clk);
 
 	stmmac_check_ether_addr(priv);
 
@@ -1078,7 +1074,7 @@ open_error:
 	if (priv->phydev)
 		phy_disconnect(priv->phydev);
 
-	stmmac_clk_disable(priv);
+	clk_disable_unprepare(priv->stmmac_clk);
 
 	return ret;
 }
@@ -1131,7 +1127,7 @@ static int stmmac_release(struct net_device *dev)
 #ifdef CONFIG_STMMAC_DEBUG_FS
 	stmmac_exit_fs();
 #endif
-	stmmac_clk_disable(priv);
+	clk_disable_unprepare(priv->stmmac_clk);
 
 	return 0;
 }
@@ -1926,11 +1922,14 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 	ret = register_netdev(ndev);
 	if (ret) {
 		pr_err("%s: ERROR %i registering the device\n", __func__, ret);
-		goto error;
+		goto error_netdev_register;
 	}
 
-	if (stmmac_clk_get(priv))
+	priv->stmmac_clk = clk_get(priv->device, NULL);
+	if (IS_ERR(priv->stmmac_clk)) {
 		pr_warning("%s: warning: cannot get CSR clock\n", __func__);
+		goto error_clk_get;
+	}
 
 	/* If a specific clk_csr value is passed from the platform
 	 * this means that the CSR Clock Range selection cannot be
@@ -1948,15 +1947,17 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 	if (ret < 0) {
 		pr_debug("%s: MDIO bus (id: %d) registration failed",
 			 __func__, priv->plat->bus_id);
-		goto error;
+		goto error_mdio_register;
 	}
 
 	return priv;
 
-error:
-	netif_napi_del(&priv->napi);
-
+error_mdio_register:
+	clk_put(priv->stmmac_clk);
+error_clk_get:
 	unregister_netdev(ndev);
+error_netdev_register:
+	netif_napi_del(&priv->napi);
 	free_netdev(ndev);
 
 	return NULL;
@@ -2025,7 +2026,7 @@ int stmmac_suspend(struct net_device *ndev)
 	else {
 		stmmac_set_mac(priv->ioaddr, false);
 		/* Disable clock in case of PWM is off */
-		stmmac_clk_disable(priv);
+		clk_disable_unprepare(priv->stmmac_clk);
 	}
 	spin_unlock_irqrestore(&priv->lock, flags);
 	return 0;
@@ -2050,7 +2051,7 @@ int stmmac_resume(struct net_device *ndev)
 		priv->hw->mac->pmt(priv->ioaddr, 0);
 	else
 		/* enable the clk prevously disabled */
-		stmmac_clk_enable(priv);
+		clk_prepare_enable(priv->stmmac_clk);
 
 	netif_device_attach(ndev);
 

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-26 12:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-12  4:07 linux-next: manual merge of the akpm tree with the net tree Stephen Rothwell
2012-06-12  4:07 ` Stephen Rothwell
2012-06-13  5:27 Stephen Rothwell
2012-06-13  5:27 ` Stephen Rothwell
2016-10-14  2:12 Stephen Rothwell
2017-02-10  7:27 Stephen Rothwell
2019-06-26 12:02 Stephen Rothwell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.