forked from linux-surface/kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipts: Move debugging settings into modparams
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
- Loading branch information
Showing
6 changed files
with
91 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
/* | ||
* | ||
* Intel Precise Touch & Stylus | ||
* Copyright (c) 2016 Intel Corporation | ||
* | ||
*/ | ||
|
||
#include <linux/device.h> | ||
#include <stdarg.h> | ||
|
||
#include "ipts.h" | ||
#include "ipts-params.h" | ||
|
||
static void ipts_printk(const char *level, const struct device *dev, | ||
struct va_format *vaf) | ||
{ | ||
if (dev) { | ||
dev_printk_emit(level[1] - '0', dev, "%s %s: %pV", | ||
dev_driver_string(dev), dev_name(dev), vaf); | ||
} else { | ||
// checkpatch wants this to be prefixed with KERN_*, but | ||
// since the level is passed as a parameter, ignore it | ||
printk("%s(NULL device *): %pV", level, vaf); | ||
} | ||
} | ||
|
||
void ipts_info(struct ipts_info *ipts, const char *fmt, ...) | ||
{ | ||
va_list args; | ||
struct va_format vaf; | ||
|
||
if (!ipts_modparams.debug) | ||
return; | ||
|
||
va_start(args, fmt); | ||
|
||
vaf.fmt = fmt; | ||
vaf.va = &args; | ||
|
||
ipts_printk(KERN_INFO, &ipts->cldev->dev, &vaf); | ||
|
||
va_end(args); | ||
} | ||
|
||
void ipts_dbg(struct ipts_info *ipts, const char *fmt, ...) | ||
{ | ||
va_list args; | ||
struct va_format vaf; | ||
|
||
if (!ipts_modparams.debug) | ||
return; | ||
|
||
va_start(args, fmt); | ||
|
||
vaf.fmt = fmt; | ||
vaf.va = &args; | ||
|
||
ipts_printk(KERN_DEBUG, &ipts->cldev->dev, &vaf); | ||
|
||
va_end(args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters