Commit 857011e4 authored by Joe Perches's avatar Joe Perches Committed by Mauro Carvalho Chehab

[media] et61x251: Use current logging styles

Add pr_fmt and convert printks to pr_<level>
Remove explicit prefixes from logging messages.
One of the prefixes was defective, a copy/paste error.
Use ##__VA_ARGS__ for variadic macros.
Whitespace neatening.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 8af443e5
...@@ -165,45 +165,49 @@ et61x251_attach_sensor(struct et61x251_device* cam, ...@@ -165,45 +165,49 @@ et61x251_attach_sensor(struct et61x251_device* cam,
#undef DBG #undef DBG
#undef KDBG #undef KDBG
#ifdef ET61X251_DEBUG #ifdef ET61X251_DEBUG
# define DBG(level, fmt, args...) \ #define DBG(level, fmt, ...) \
do { \ do { \
if (debug >= (level)) { \ if (debug >= (level)) { \
if ((level) == 1) \ if ((level) == 1) \
dev_err(&cam->usbdev->dev, fmt "\n", ## args); \ dev_err(&cam->usbdev->dev, fmt "\n", \
else if ((level) == 2) \ ##__VA_ARGS__); \
dev_info(&cam->usbdev->dev, fmt "\n", ## args); \ else if ((level) == 2) \
else if ((level) >= 3) \ dev_info(&cam->usbdev->dev, fmt "\n", \
dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", \ ##__VA_ARGS__); \
__FILE__, __func__, __LINE__ , ## args); \ else if ((level) >= 3) \
} \ dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", \
__FILE__, __func__, __LINE__, \
##__VA_ARGS__); \
} \
} while (0) } while (0)
# define KDBG(level, fmt, args...) \ #define KDBG(level, fmt, ...) \
do { \ do { \
if (debug >= (level)) { \ if (debug >= (level)) { \
if ((level) == 1 || (level) == 2) \ if ((level) == 1 || (level) == 2) \
pr_info("et61x251: " fmt "\n", ## args); \ pr_info(fmt "\n", ##__VA_ARGS__); \
else if ((level) == 3) \ else if ((level) == 3) \
pr_debug("sn9c102: [%s:%s:%d] " fmt "\n", __FILE__, \ pr_debug("[%s:%s:%d] " fmt "\n", \
__func__, __LINE__ , ## args); \ __FILE__, __func__, __LINE__, \
} \ ##__VA_ARGS__); \
} \
} while (0) } while (0)
# define V4LDBG(level, name, cmd) \ #define V4LDBG(level, name, cmd) \
do { \ do { \
if (debug >= (level)) \ if (debug >= (level)) \
v4l_print_ioctl(name, cmd); \ v4l_print_ioctl(name, cmd); \
} while (0) } while (0)
#else #else
# define DBG(level, fmt, args...) do {;} while(0) #define DBG(level, fmt, ...) do {;} while(0)
# define KDBG(level, fmt, args...) do {;} while(0) #define KDBG(level, fmt, ...) do {;} while(0)
# define V4LDBG(level, name, cmd) do {;} while(0) #define V4LDBG(level, name, cmd) do {;} while(0)
#endif #endif
#undef PDBG #undef PDBG
#define PDBG(fmt, args...) \ #define PDBG(fmt, ...) \
dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", __FILE__, __func__, \ dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", \
__LINE__ , ## args) __FILE__, __func__, __LINE__, ##__VA_ARGS__)
#undef PDBGG #undef PDBGG
#define PDBGG(fmt, args...) do {;} while(0) /* placeholder */ #define PDBGG(fmt, args...) do {;} while (0) /* placeholder */
#endif /* _ET61X251_H_ */ #endif /* _ET61X251_H_ */
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
***************************************************************************/ ***************************************************************************/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/version.h> #include <linux/version.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
***************************************************************************/ ***************************************************************************/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include "et61x251_sensor.h" #include "et61x251_sensor.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment