[media] siano: use pr_* print functions
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 22 Feb 2015 13:46:56 +0000 (10:46 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 26 Feb 2015 12:10:01 +0000 (09:10 -0300)
Instead of defining its own set of printk functions, let's
use the common Kernel debug logic provided by pr_foo functions.

As a first step, let's just define the existing macros as the
Kernel ones.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/common/siano/sms-cards.h
drivers/media/common/siano/smscoreapi.c
drivers/media/common/siano/smscoreapi.h
drivers/media/common/siano/smsdvb-debugfs.c
drivers/media/common/siano/smsdvb-main.c
drivers/media/common/siano/smsir.c
drivers/media/mmc/siano/smssdio.c
drivers/media/usb/siano/smsusb.c

index 4c4caddf986984e2aa94ce2da8bf7f1229718767..bb3d733f092b5b79b0ac69181095fcb3ac689d39 100644 (file)
@@ -20,8 +20,9 @@
 #ifndef __SMS_CARDS_H__
 #define __SMS_CARDS_H__
 
-#include <linux/usb.h>
 #include "smscoreapi.h"
+
+#include <linux/usb.h>
 #include "smsir.h"
 
 #define SMS_BOARD_UNKNOWN 0
index a3677438205e8c88824e6f10f854168755725da9..26dc4392c3e17cc417cd566e0f7f0d694263eb77 100644 (file)
@@ -21,6 +21,8 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "smscoreapi.h"
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
@@ -34,7 +36,6 @@
 #include <linux/wait.h>
 #include <asm/byteorder.h>
 
-#include "smscoreapi.h"
 #include "sms-cards.h"
 #include "smsir.h"
 
index efe4ab090aec0a5916f1915ba63117b6808b19e6..b5d85fd0bee834b3d50e29c4ffa20441aa337888 100644 (file)
@@ -22,6 +22,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef __SMS_CORE_API_H__
 #define __SMS_CORE_API_H__
 
+#define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__
+
 #include <linux/device.h>
 #include <linux/list.h>
 #include <linux/mm.h>
@@ -1177,22 +1179,17 @@ int smscore_led_state(struct smscore_device_t *core, int led);
 #define DBG_INFO 1
 #define DBG_ADV  2
 
-#define sms_printk(kern, fmt, arg...) \
-       printk(kern "%s: " fmt "\n", __func__, ##arg)
-
-#define dprintk(kern, lvl, fmt, arg...) do {\
-       if (sms_dbg & lvl) \
-               sms_printk(kern, fmt, ##arg); \
+#define sms_log(fmt, arg...) pr_info(fmt "\n", ##arg)
+#define sms_err(fmt, arg...) pr_err(fmt " on line: %d\n", ##arg, __LINE__)
+#define sms_warn(fmt, arg...) pr_warn(fmt "\n", ##arg)
+#define sms_info(fmt, arg...) do {\
+       if (sms_dbg & DBG_INFO) \
+               pr_info(fmt "\n", ##arg); \
 } while (0)
 
-#define sms_log(fmt, arg...) sms_printk(KERN_INFO, fmt, ##arg)
-#define sms_err(fmt, arg...) \
-       sms_printk(KERN_ERR, "line: %d: " fmt, __LINE__, ##arg)
-#define sms_warn(fmt, arg...)  sms_printk(KERN_WARNING, fmt, ##arg)
-#define sms_info(fmt, arg...) \
-       dprintk(KERN_INFO, DBG_INFO, fmt, ##arg)
-#define sms_debug(fmt, arg...) \
-       dprintk(KERN_DEBUG, DBG_ADV, fmt, ##arg)
-
+#define sms_debug(fmt, arg...) do {\
+        if (sms_dbg & DBG_ADV) \
+                printk(KERN_DEBUG pr_fmt(fmt "\n"), ##arg); \
+} while (0)
 
 #endif /* __SMS_CORE_API_H__ */
index 2408d7e9451eaea0608fdbb3ea9ef3b0ee0c36c2..c3e1a404e4f60d200ab98f48b92319888229e698 100644 (file)
@@ -17,7 +17,7 @@
  *
  ***********************************************************************/
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include "smscoreapi.h"
 
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -31,8 +31,6 @@
 #include "dvb_demux.h"
 #include "dvb_frontend.h"
 
-#include "smscoreapi.h"
-
 #include "smsdvb.h"
 
 static struct dentry *smsdvb_debugfs_usb_root;
index 042515915e205c373b27d5566d113ed632367cd8..6eb1b14092cbe6bc95c23e2fa9d24c50cc7f2a7b 100644 (file)
@@ -19,6 +19,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ****************************************************************/
 
+#include "smscoreapi.h"
+
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
@@ -29,7 +31,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "dvb_demux.h"
 #include "dvb_frontend.h"
 
-#include "smscoreapi.h"
 #include "sms-cards.h"
 
 #include "smsdvb.h"
index 35d0e887bd6562ea53eda53482f9075ac282186e..2dcae6ace282977dc4edf16aa437101684ee957f 100644 (file)
  ****************************************************************/
 
 
+#include "smscoreapi.h"
+
 #include <linux/types.h>
 #include <linux/input.h>
 
-#include "smscoreapi.h"
 #include "smsir.h"
 #include "sms-cards.h"
 
index 912c2814c6cf3ec8ac77f29f487076691c2f7618..4e61544c34b930f6df5ddda333318aabcb656fce 100644 (file)
@@ -32,6 +32,8 @@
  * Fix stop command
  */
 
+#include "smscoreapi.h"
+
 #include <linux/moduleparam.h>
 #include <linux/slab.h>
 #include <linux/firmware.h>
@@ -41,7 +43,6 @@
 #include <linux/mmc/sdio_ids.h>
 #include <linux/module.h>
 
-#include "smscoreapi.h"
 #include "sms-cards.h"
 #include "smsendian.h"
 
index 4b6db7557e33c6cec3d1648f7e5b3521f9ce02b3..426455118d02cc12d4a60f0232e3df06aecaf282 100644 (file)
@@ -19,6 +19,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ****************************************************************/
 
+#include "smscoreapi.h"
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/usb.h>
@@ -26,7 +28,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <linux/slab.h>
 #include <linux/module.h>
 
-#include "smscoreapi.h"
 #include "sms-cards.h"
 #include "smsendian.h"
 
This page took 0.029801 seconds and 5 git commands to generate.