Merge branch 'for-6.3/multitouch' into for-linus
[platform/kernel/linux-rpi.git] / drivers / hid / i2c-hid / i2c-hid-core.c
index 72f2c37..efbba04 100644 (file)
 #define I2C_HID_PWR_ON         0x00
 #define I2C_HID_PWR_SLEEP      0x01
 
-/* debug option */
-static bool debug;
-module_param(debug, bool, 0444);
-MODULE_PARM_DESC(debug, "print a lot of debug information");
-
-#define i2c_hid_dbg(ihid, fmt, arg...)                                   \
-do {                                                                     \
-       if (debug)                                                        \
-               dev_printk(KERN_DEBUG, &(ihid)->client->dev, fmt, ##arg); \
-} while (0)
+#define i2c_hid_dbg(ihid, ...) dev_dbg(&(ihid)->client->dev, __VA_ARGS__)
 
 struct i2c_hid_desc {
        __le16 wHIDDescLength;
@@ -842,7 +833,7 @@ static void i2c_hid_close(struct hid_device *hid)
        clear_bit(I2C_HID_STARTED, &ihid->flags);
 }
 
-struct hid_ll_driver i2c_hid_ll_driver = {
+static const struct hid_ll_driver i2c_hid_ll_driver = {
        .parse = i2c_hid_parse,
        .start = i2c_hid_start,
        .stop = i2c_hid_stop,
@@ -851,7 +842,6 @@ struct hid_ll_driver i2c_hid_ll_driver = {
        .output_report = i2c_hid_output_report,
        .raw_request = i2c_hid_raw_request,
 };
-EXPORT_SYMBOL_GPL(i2c_hid_ll_driver);
 
 static int i2c_hid_init_irq(struct i2c_client *client)
 {
@@ -859,7 +849,7 @@ static int i2c_hid_init_irq(struct i2c_client *client)
        unsigned long irqflags = 0;
        int ret;
 
-       dev_dbg(&client->dev, "Requesting IRQ: %d\n", client->irq);
+       i2c_hid_dbg(ihid, "Requesting IRQ: %d\n", client->irq);
 
        if (!irq_get_trigger_type(client->irq))
                irqflags = IRQF_TRIGGER_LOW;
@@ -1003,7 +993,7 @@ int i2c_hid_core_probe(struct i2c_client *client, struct i2chid_ops *ops,
        /* Make sure there is something at this address */
        ret = i2c_smbus_read_byte(client);
        if (ret < 0) {
-               dev_dbg(&client->dev, "nothing at this address: %d\n", ret);
+               i2c_hid_dbg(ihid, "nothing at this address: %d\n", ret);
                ret = -ENXIO;
                goto err_powered;
        }