Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222827 > unrolled thread

[PATCH 1/3] staging: fbtft: use dev_*

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2015-09-11 15:00 +0200
Last post2015-09-11 15:00 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] staging: fbtft: use dev_* Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-11 15:00 +0200
    [PATCH 3/3] staging: fbtft: change log level Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-11 15:00 +0200

#1222827 — [PATCH 1/3] staging: fbtft: use dev_*

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-09-11 15:00 +0200
Subject[PATCH 1/3] staging: fbtft: use dev_*
Message-ID<q7w5P-203-11@gated-at.bofh.it>
Use dev_* family of macros where we have a reference of a device.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

Greg,
In fbtft_device_spi_delete() you told to make that as dev_debug, but
since that dev_info is already under verbose so I kept it as it is.	

 drivers/staging/fbtft/fbtft_device.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c b/drivers/staging/fbtft/fbtft_device.c
index 80ab918..95985726 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1215,9 +1215,9 @@ static int spi_device_found(struct device *dev, void *data)
 {
 	struct spi_device *spi = container_of(dev, struct spi_device, dev);
 
-	pr_info(DRVNAME":      %s %s %dkHz %d bits mode=0x%02X\n",
-		spi->modalias, dev_name(dev), spi->max_speed_hz / 1000,
-		spi->bits_per_word, spi->mode);
+	dev_info(dev, "%s %s %dkHz %d bits mode=0x%02X\n", spi->modalias,
+		 dev_name(dev), spi->max_speed_hz / 1000, spi->bits_per_word,
+		 spi->mode);
 
 	return 0;
 }
@@ -1234,9 +1234,8 @@ static int p_device_found(struct device *dev, void *data)
 	*pdev = container_of(dev, struct platform_device, dev);
 
 	if (strstr(pdev->name, "fb"))
-		pr_info(DRVNAME":      %s id=%d pdata? %s\n",
-				pdev->name, pdev->id,
-				pdev->dev.platform_data ? "yes" : "no");
+		dev_info(dev, "%s id=%d pdata? %s\n", pdev->name, pdev->id,
+			 pdev->dev.platform_data ? "yes" : "no");
 
 	return 0;
 }
@@ -1258,7 +1257,7 @@ static void fbtft_device_spi_delete(struct spi_master *master, unsigned cs)
 	dev = bus_find_device_by_name(&spi_bus_type, NULL, str);
 	if (dev) {
 		if (verbose)
-			pr_info(DRVNAME": Deleting %s\n", str);
+			dev_info(dev, "Deleting %s\n", str);
 		device_del(dev);
 	}
 }
@@ -1278,7 +1277,7 @@ static int fbtft_device_spi_device_register(struct spi_board_info *spi)
 	spi_device = spi_new_device(master, spi);
 	put_device(&master->dev);
 	if (!spi_device) {
-		pr_err(DRVNAME ":    spi_new_device() returned NULL\n");
+		dev_err(&master->dev, "spi_new_device() returned NULL\n");
 		return -EPERM;
 	}
 	return 0;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1222829 — [PATCH 3/3] staging: fbtft: change log level

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-09-11 15:00 +0200
Subject[PATCH 3/3] staging: fbtft: change log level
Message-ID<q7w5Q-203-25@gated-at.bofh.it>
In reply to#1222827
Reduce the log level of some of the pr_* calls and remove 2 pr_debug
calls which just prints "init" and "exit".

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/staging/fbtft/fbtft_device.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c b/drivers/staging/fbtft/fbtft_device.c
index a820d4c..6d868e0 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1223,7 +1223,7 @@ static int spi_device_found(struct device *dev, void *data)
 
 static void pr_spi_devices(void)
 {
-	pr_info("SPI devices registered:\n");
+	pr_debug("SPI devices registered:\n");
 	bus_for_each_dev(&spi_bus_type, NULL, NULL, spi_device_found);
 }
 
@@ -1241,7 +1241,7 @@ static int p_device_found(struct device *dev, void *data)
 
 static void pr_p_devices(void)
 {
-	pr_info("'fb' Platform devices registered:\n");
+	pr_debug("'fb' Platform devices registered:\n");
 	bus_for_each_dev(&platform_bus_type, NULL, NULL, p_device_found);
 }
 
@@ -1299,8 +1299,6 @@ static int __init fbtft_device_init(void)
 	long val;
 	int ret = 0;
 
-	pr_debug("init\n");
-
 	if (name == NULL) {
 #ifdef MODULE
 		pr_err("missing module parameter: 'name'\n");
@@ -1479,8 +1477,6 @@ static int __init fbtft_device_init(void)
 
 static void __exit fbtft_device_exit(void)
 {
-	pr_debug("exit\n");
-
 	if (spi_device) {
 		device_del(&spi_device->dev);
 		kfree(spi_device);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web