netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] stmmac: platform: adjust messages and move to dev level
@ 2014-12-09  9:59 Andy Shevchenko
  2014-12-09 23:28 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2014-12-09  9:59 UTC (permalink / raw)
  To: Giuseppe Cavallaro, David S . Miller, netdev; +Cc: Andy Shevchenko

This patch amendes error and warning messages across the platform driver. It
includes the following changes:
 - remove unneccessary message when no memory is available
 - change info level to warn in the validation functions
 - append \n to the end of messages
 - change pr_* macros to dev_*

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  | 37 ++++++++++++----------
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 4032b17..e809b30 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -53,6 +53,7 @@ MODULE_DEVICE_TABLE(of, stmmac_dt_ids);
 
 /**
  * dwmac1000_validate_mcast_bins - validates the number of Multicast filter bins
+ * @dev: struct device of the platform device
  * @mcast_bins: Multicast filtering bins
  * Description:
  * this function validates the number of Multicast filtering bins specified
@@ -63,7 +64,7 @@ MODULE_DEVICE_TABLE(of, stmmac_dt_ids);
  * invalid and will cause the filtering algorithm to use Multicast
  * promiscuous mode.
  */
-static int dwmac1000_validate_mcast_bins(int mcast_bins)
+static int dwmac1000_validate_mcast_bins(struct device *dev, int mcast_bins)
 {
 	int x = mcast_bins;
 
@@ -74,8 +75,8 @@ static int dwmac1000_validate_mcast_bins(int mcast_bins)
 		break;
 	default:
 		x = 0;
-		pr_info("Hash table entries set to unexpected value %d",
-			mcast_bins);
+		dev_warn(dev, "Hash table entries set to unexpected value %d\n",
+			 mcast_bins);
 		break;
 	}
 	return x;
@@ -83,6 +84,7 @@ static int dwmac1000_validate_mcast_bins(int mcast_bins)
 
 /**
  * dwmac1000_validate_ucast_entries - validate the Unicast address entries
+ * @dev: struct device of the platform device
  * @ucast_entries: number of Unicast address entries
  * Description:
  * This function validates the number of Unicast address entries supported
@@ -92,7 +94,8 @@ static int dwmac1000_validate_mcast_bins(int mcast_bins)
  * selected, and defaults to 1 Unicast address if an unsupported
  * configuration is selected.
  */
-static int dwmac1000_validate_ucast_entries(int ucast_entries)
+static int dwmac1000_validate_ucast_entries(struct device *dev,
+					    int ucast_entries)
 {
 	int x = ucast_entries;
 
@@ -104,8 +107,9 @@ static int dwmac1000_validate_ucast_entries(int ucast_entries)
 		break;
 	default:
 		x = 1;
-		pr_info("Unicast table entries set to unexpected value %d\n",
-			ucast_entries);
+		dev_warn(dev,
+			 "Unicast table entries set to unexpected value %d\n",
+			 ucast_entries);
 		break;
 	}
 	return x;
@@ -209,9 +213,9 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
 		of_property_read_u32(np, "snps,perfect-filter-entries",
 				     &plat->unicast_filter_entries);
 		plat->unicast_filter_entries = dwmac1000_validate_ucast_entries(
-					       plat->unicast_filter_entries);
+				&pdev->dev, plat->unicast_filter_entries);
 		plat->multicast_filter_bins = dwmac1000_validate_mcast_bins(
-					      plat->multicast_filter_bins);
+				&pdev->dev, plat->multicast_filter_bins);
 		plat->has_gmac = 1;
 		plat->pmt = 1;
 	}
@@ -238,7 +242,8 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
 	plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode");
 	if (plat->force_thresh_dma_mode) {
 		plat->force_sf_dma_mode = 0;
-		pr_warn("force_sf_dma_mode is ignored if force_thresh_dma_mode is set.");
+		dev_warn(&pdev->dev,
+			 "force_sf_dma_mode is ignored if force_thresh_dma_mode is set.\n");
 	}
 
 	return 0;
@@ -280,10 +285,8 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
 		plat_dat = devm_kzalloc(&pdev->dev,
 					sizeof(struct plat_stmmacenet_data),
 					GFP_KERNEL);
-	if (!plat_dat) {
-		pr_err("%s: ERROR: no memory", __func__);
+	if (!plat_dat)
 		return  -ENOMEM;
-	}
 
 	/* Set default value for multicast hash bins */
 	plat_dat->multicast_filter_bins = HASH_TABLE_SIZE;
@@ -294,7 +297,8 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
 	if (pdev->dev.of_node) {
 		ret = stmmac_probe_config_dt(pdev, plat_dat, &mac);
 		if (ret) {
-			pr_err("%s: main dt probe failed", __func__);
+			dev_err(&pdev->dev, "%s: main dt probe failed\n",
+				__func__);
 			return ret;
 		}
 	}
@@ -313,9 +317,10 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
 			return ret;
 	}
 
-	priv = stmmac_dvr_probe(&(pdev->dev), plat_dat, addr);
+	priv = stmmac_dvr_probe(&pdev->dev, plat_dat, addr);
 	if (IS_ERR(priv)) {
-		pr_err("%s: main driver probe failed", __func__);
+		dev_err(&pdev->dev, "%s: main driver probe failed\n",
+			__func__);
 		return PTR_ERR(priv);
 	}
 
@@ -354,7 +359,7 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, priv->dev);
 
-	pr_debug("STMMAC platform driver registration completed");
+	dev_dbg(&pdev->dev, "STMMAC platform driver registration completed\n");
 
 	return 0;
 }
-- 
2.1.3

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

* Re: [PATCH] stmmac: platform: adjust messages and move to dev level
  2014-12-09  9:59 [PATCH] stmmac: platform: adjust messages and move to dev level Andy Shevchenko
@ 2014-12-09 23:28 ` David Miller
  2014-12-10 10:47   ` Andy Shevchenko
  2015-01-27 16:41   ` Andy Shevchenko
  0 siblings, 2 replies; 6+ messages in thread
From: David Miller @ 2014-12-09 23:28 UTC (permalink / raw)
  To: andriy.shevchenko; +Cc: peppe.cavallaro, netdev

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Tue,  9 Dec 2014 11:59:13 +0200

> This patch amendes error and warning messages across the platform driver. It
> includes the following changes:
>  - remove unneccessary message when no memory is available
>  - change info level to warn in the validation functions
>  - append \n to the end of messages
>  - change pr_* macros to dev_*
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

This does not apply to the net-next tree, please respin.

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

* Re: [PATCH] stmmac: platform: adjust messages and move to dev level
  2014-12-09 23:28 ` David Miller
@ 2014-12-10 10:47   ` Andy Shevchenko
  2014-12-10 16:44     ` David Miller
  2015-01-27 16:41   ` Andy Shevchenko
  1 sibling, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2014-12-10 10:47 UTC (permalink / raw)
  To: David Miller; +Cc: peppe.cavallaro, netdev

On Tue, 2014-12-09 at 18:28 -0500, David Miller wrote:
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Date: Tue,  9 Dec 2014 11:59:13 +0200
> 
> > This patch amendes error and warning messages across the platform driver. It
> > includes the following changes:
> >  - remove unneccessary message when no memory is available
> >  - change info level to warn in the validation functions
> >  - append \n to the end of messages
> >  - change pr_* macros to dev_*
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> This does not apply to the net-next tree, please respin.

Yeah, maybe because the fix (*) you mentioned in previos mail is not in
net-next by some reason?

(*) I refer to commit 28603d13997e2ef47f18589cc9a44553aad49c86

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy

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

* Re: [PATCH] stmmac: platform: adjust messages and move to dev level
  2014-12-10 10:47   ` Andy Shevchenko
@ 2014-12-10 16:44     ` David Miller
  2014-12-12 11:56       ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2014-12-10 16:44 UTC (permalink / raw)
  To: andriy.shevchenko; +Cc: peppe.cavallaro, netdev

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Wed, 10 Dec 2014 12:47:51 +0200

> On Tue, 2014-12-09 at 18:28 -0500, David Miller wrote:
>> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> Date: Tue,  9 Dec 2014 11:59:13 +0200
>> 
>> > This patch amendes error and warning messages across the platform driver. It
>> > includes the following changes:
>> >  - remove unneccessary message when no memory is available
>> >  - change info level to warn in the validation functions
>> >  - append \n to the end of messages
>> >  - change pr_* macros to dev_*
>> > 
>> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> 
>> This does not apply to the net-next tree, please respin.
> 
> Yeah, maybe because the fix (*) you mentioned in previos mail is not in
> net-next by some reason?
> 
> (*) I refer to commit 28603d13997e2ef47f18589cc9a44553aad49c86

It's in the 'net' tree which hasn't been merged into net-next.

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

* Re: [PATCH] stmmac: platform: adjust messages and move to dev level
  2014-12-10 16:44     ` David Miller
@ 2014-12-12 11:56       ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2014-12-12 11:56 UTC (permalink / raw)
  To: David Miller; +Cc: peppe.cavallaro, netdev

On Wed, 2014-12-10 at 11:44 -0500, David Miller wrote:
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Date: Wed, 10 Dec 2014 12:47:51 +0200
> 
> > On Tue, 2014-12-09 at 18:28 -0500, David Miller wrote:
> >> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >> Date: Tue,  9 Dec 2014 11:59:13 +0200
> >> 
> >> > This patch amendes error and warning messages across the platform driver. It
> >> > includes the following changes:
> >> >  - remove unneccessary message when no memory is available
> >> >  - change info level to warn in the validation functions
> >> >  - append \n to the end of messages
> >> >  - change pr_* macros to dev_*
> >> > 
> >> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >> 
> >> This does not apply to the net-next tree, please respin.
> > 
> > Yeah, maybe because the fix (*) you mentioned in previos mail is not in
> > net-next by some reason?
> > 
> > (*) I refer to commit 28603d13997e2ef47f18589cc9a44553aad49c86
> 
> It's in the 'net' tree which hasn't been merged into net-next.

It seems it can be clearly applied on top of recent net-next.

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy

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

* Re: [PATCH] stmmac: platform: adjust messages and move to dev level
  2014-12-09 23:28 ` David Miller
  2014-12-10 10:47   ` Andy Shevchenko
@ 2015-01-27 16:41   ` Andy Shevchenko
  1 sibling, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2015-01-27 16:41 UTC (permalink / raw)
  To: David Miller; +Cc: peppe.cavallaro, netdev

On Tue, 2014-12-09 at 18:28 -0500, David Miller wrote:
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Date: Tue,  9 Dec 2014 11:59:13 +0200
> 
> > This patch amendes error and warning messages across the platform driver. It
> > includes the following changes:
> >  - remove unneccessary message when no memory is available
> >  - change info level to warn in the validation functions
> >  - append \n to the end of messages
> >  - change pr_* macros to dev_*
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> This does not apply to the net-next tree, please respin.

Gently ping on this patch. It smoothly applies to the current net-next,
IIUC.

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy

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

end of thread, other threads:[~2015-01-27 16:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-09  9:59 [PATCH] stmmac: platform: adjust messages and move to dev level Andy Shevchenko
2014-12-09 23:28 ` David Miller
2014-12-10 10:47   ` Andy Shevchenko
2014-12-10 16:44     ` David Miller
2014-12-12 11:56       ` Andy Shevchenko
2015-01-27 16:41   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).