summaryrefslogtreecommitdiff
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2026-02-23 12:09:45 +0300
committerMaxime Ripard <mripard@kernel.org>2026-02-23 12:09:45 +0300
commitc17ee635fd3a482b2ad2bf5e269755c2eae5f25e (patch)
treee3f147462d8a9fd0cf2312c8cd3c5a94da15c3e4 /drivers/input/misc
parent803ec1faf7c1823e6e3b1f2aaa81be18528c9436 (diff)
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f (diff)
downloadlinux-c17ee635fd3a482b2ad2bf5e269755c2eae5f25e.tar.xz
Merge drm/drm-fixes into drm-misc-fixes
7.0-rc1 was just released, let's merge it to kick the new release cycle. Signed-off-by: Maxime Ripard <mripard@kernel.org>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/88pm80x_onkey.c2
-rw-r--r--drivers/input/misc/ati_remote2.c2
-rw-r--r--drivers/input/misc/cm109.c4
-rw-r--r--drivers/input/misc/cma3000_d0x.c2
-rw-r--r--drivers/input/misc/cs40l50-vibra.c8
-rw-r--r--drivers/input/misc/da9052_onkey.c2
-rw-r--r--drivers/input/misc/gpio_decoder.c74
-rw-r--r--drivers/input/misc/ims-pcu.c4
-rw-r--r--drivers/input/misc/keyspan_remote.c2
-rw-r--r--drivers/input/misc/max8997_haptic.c2
-rw-r--r--drivers/input/misc/mc13783-pwrbutton.c2
-rw-r--r--drivers/input/misc/palmas-pwrbutton.c4
-rw-r--r--drivers/input/misc/pcap_keys.c2
-rw-r--r--drivers/input/misc/pcf8574_keypad.c2
-rw-r--r--drivers/input/misc/pf1550-onkey.c2
-rw-r--r--drivers/input/misc/powermate.c4
-rw-r--r--drivers/input/misc/twl4030-pwrbutton.c67
-rw-r--r--drivers/input/misc/uinput.c2
-rw-r--r--drivers/input/misc/xen-kbdfront.c2
-rw-r--r--drivers/input/misc/yealink.c4
20 files changed, 116 insertions, 77 deletions
diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c
index 9159b5fec129..fee28e537898 100644
--- a/drivers/input/misc/88pm80x_onkey.c
+++ b/drivers/input/misc/88pm80x_onkey.c
@@ -57,7 +57,7 @@ static int pm80x_onkey_probe(struct platform_device *pdev)
struct pm80x_onkey_info *info;
int err;
- info = kzalloc(sizeof(*info), GFP_KERNEL);
+ info = kzalloc_obj(*info);
if (!info)
return -ENOMEM;
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index e84649af801d..8db2dca84975 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -772,7 +772,7 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d
if (alt->desc.bInterfaceNumber)
return -ENODEV;
- ar2 = kzalloc(sizeof (struct ati_remote2), GFP_KERNEL);
+ ar2 = kzalloc_obj(struct ati_remote2);
if (!ar2)
return -ENOMEM;
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index 0cfe5d4a573c..353d3c1d347d 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -696,7 +696,7 @@ static int cm109_usb_probe(struct usb_interface *intf,
if (!usb_endpoint_is_int_in(endpoint))
return -ENODEV;
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = kzalloc_obj(*dev);
if (!dev)
return -ENOMEM;
@@ -721,7 +721,7 @@ static int cm109_usb_probe(struct usb_interface *intf,
if (!dev->ctl_data)
goto err_out;
- dev->ctl_req = kmalloc(sizeof(*(dev->ctl_req)), GFP_KERNEL);
+ dev->ctl_req = kmalloc_obj(*(dev->ctl_req));
if (!dev->ctl_req)
goto err_out;
diff --git a/drivers/input/misc/cma3000_d0x.c b/drivers/input/misc/cma3000_d0x.c
index b4232b0a3957..a641453188d9 100644
--- a/drivers/input/misc/cma3000_d0x.c
+++ b/drivers/input/misc/cma3000_d0x.c
@@ -285,7 +285,7 @@ struct cma3000_accl_data *cma3000_init(struct device *dev, int irq,
goto err_out;
}
- data = kzalloc(sizeof(*data), GFP_KERNEL);
+ data = kzalloc_obj(*data);
input_dev = input_allocate_device();
if (!data || !input_dev) {
error = -ENOMEM;
diff --git a/drivers/input/misc/cs40l50-vibra.c b/drivers/input/misc/cs40l50-vibra.c
index 7aa7d577e01b..996d6c38cca4 100644
--- a/drivers/input/misc/cs40l50-vibra.c
+++ b/drivers/input/misc/cs40l50-vibra.c
@@ -276,7 +276,7 @@ static void cs40l50_add_worker(struct work_struct *work)
/* Update effect if already uploaded, otherwise create new effect */
effect = cs40l50_find_effect(work_data->effect->id, &vib->effect_head);
if (!effect) {
- effect = kzalloc(sizeof(*effect), GFP_KERNEL);
+ effect = kzalloc_obj(*effect);
if (!effect) {
error = -ENOMEM;
goto err_pm;
@@ -308,7 +308,6 @@ err_free:
list_add(&effect->list, &vib->effect_head);
}
err_pm:
- pm_runtime_mark_last_busy(vib->dev);
pm_runtime_put_autosuspend(vib->dev);
err_exit:
work_data->error = error;
@@ -368,7 +367,6 @@ static void cs40l50_start_worker(struct work_struct *work)
dev_err(vib->dev, "Effect to play not found\n");
}
- pm_runtime_mark_last_busy(vib->dev);
pm_runtime_put_autosuspend(vib->dev);
err_free:
kfree(work_data);
@@ -384,7 +382,6 @@ static void cs40l50_stop_worker(struct work_struct *work)
vib->dsp.write(vib->dev, vib->regmap, vib->dsp.stop_cmd);
- pm_runtime_mark_last_busy(vib->dev);
pm_runtime_put_autosuspend(vib->dev);
kfree(work_data);
@@ -395,7 +392,7 @@ static int cs40l50_playback(struct input_dev *dev, int effect_id, int val)
struct cs40l50_vibra *vib = input_get_drvdata(dev);
struct cs40l50_work *work_data;
- work_data = kzalloc(sizeof(*work_data), GFP_ATOMIC);
+ work_data = kzalloc_obj(*work_data, GFP_ATOMIC);
if (!work_data)
return -ENOMEM;
@@ -456,7 +453,6 @@ static void cs40l50_erase_worker(struct work_struct *work)
list_del(&erase_effect->list);
kfree(erase_effect);
err_pm:
- pm_runtime_mark_last_busy(vib->dev);
pm_runtime_put_autosuspend(vib->dev);
err_exit:
work_data->error = error;
diff --git a/drivers/input/misc/da9052_onkey.c b/drivers/input/misc/da9052_onkey.c
index cc23625019e3..180b3bc76525 100644
--- a/drivers/input/misc/da9052_onkey.c
+++ b/drivers/input/misc/da9052_onkey.c
@@ -80,7 +80,7 @@ static int da9052_onkey_probe(struct platform_device *pdev)
return -EINVAL;
}
- onkey = kzalloc(sizeof(*onkey), GFP_KERNEL);
+ onkey = kzalloc_obj(*onkey);
input_dev = input_allocate_device();
if (!onkey || !input_dev) {
dev_err(&pdev->dev, "Failed to allocate memory\n");
diff --git a/drivers/input/misc/gpio_decoder.c b/drivers/input/misc/gpio_decoder.c
index ee668eba302f..f0759dd39b35 100644
--- a/drivers/input/misc/gpio_decoder.c
+++ b/drivers/input/misc/gpio_decoder.c
@@ -6,13 +6,18 @@
* encoded numeric value into an input event.
*/
-#include <linux/device.h>
+#include <linux/bitmap.h>
+#include <linux/dev_printk.h>
+#include <linux/device/devres.h>
+#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/input.h>
-#include <linux/kernel.h>
+#include <linux/minmax.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/of.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
+#include <linux/types.h>
struct gpio_decoder {
struct gpio_descs *input_gpios;
@@ -24,23 +29,18 @@ struct gpio_decoder {
static int gpio_decoder_get_gpios_state(struct gpio_decoder *decoder)
{
struct gpio_descs *gpios = decoder->input_gpios;
- unsigned int ret = 0;
- int i, val;
-
- for (i = 0; i < gpios->ndescs; i++) {
- val = gpiod_get_value_cansleep(gpios->desc[i]);
- if (val < 0) {
- dev_err(decoder->dev,
- "Error reading gpio %d: %d\n",
- desc_to_gpio(gpios->desc[i]), val);
- return val;
- }
-
- val = !!val;
- ret = (ret << 1) | val;
+ DECLARE_BITMAP(values, 32);
+ unsigned int size;
+ int err;
+
+ size = min(gpios->ndescs, 32U);
+ err = gpiod_get_array_value_cansleep(size, gpios->desc, gpios->info, values);
+ if (err) {
+ dev_err(decoder->dev, "Error reading GPIO: %d\n", err);
+ return err;
}
- return ret;
+ return bitmap_read(values, 0, size);
}
static void gpio_decoder_poll_gpios(struct input_dev *input)
@@ -61,7 +61,7 @@ static int gpio_decoder_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct gpio_decoder *decoder;
struct input_dev *input;
- u32 max;
+ u32 max;
int err;
decoder = devm_kzalloc(dev, sizeof(*decoder), GFP_KERNEL);
@@ -72,18 +72,18 @@ static int gpio_decoder_probe(struct platform_device *pdev)
device_property_read_u32(dev, "linux,axis", &decoder->axis);
decoder->input_gpios = devm_gpiod_get_array(dev, NULL, GPIOD_IN);
- if (IS_ERR(decoder->input_gpios)) {
- dev_err(dev, "unable to acquire input gpios\n");
- return PTR_ERR(decoder->input_gpios);
- }
+ if (IS_ERR(decoder->input_gpios))
+ return dev_err_probe(dev, PTR_ERR(decoder->input_gpios),
+ "unable to acquire input gpios\n");
- if (decoder->input_gpios->ndescs < 2) {
- dev_err(dev, "not enough gpios found\n");
- return -EINVAL;
- }
+ if (decoder->input_gpios->ndescs < 2)
+ return dev_err_probe(dev, -EINVAL, "not enough gpios found\n");
+
+ if (decoder->input_gpios->ndescs > 31)
+ return dev_err_probe(dev, -EINVAL, "too many gpios found\n");
if (device_property_read_u32(dev, "decoder-max-value", &max))
- max = (1U << decoder->input_gpios->ndescs) - 1;
+ max = BIT(decoder->input_gpios->ndescs) - 1;
input = devm_input_allocate_device(dev);
if (!input)
@@ -96,33 +96,27 @@ static int gpio_decoder_probe(struct platform_device *pdev)
input_set_abs_params(input, decoder->axis, 0, max, 0, 0);
err = input_setup_polling(input, gpio_decoder_poll_gpios);
- if (err) {
- dev_err(dev, "failed to set up polling\n");
- return err;
- }
+ if (err)
+ return dev_err_probe(dev, err, "failed to set up polling\n");
err = input_register_device(input);
- if (err) {
- dev_err(dev, "failed to register input device\n");
- return err;
- }
+ if (err)
+ return dev_err_probe(dev, err, "failed to register input device\n");
return 0;
}
-#ifdef CONFIG_OF
static const struct of_device_id gpio_decoder_of_match[] = {
{ .compatible = "gpio-decoder", },
- { },
+ { }
};
MODULE_DEVICE_TABLE(of, gpio_decoder_of_match);
-#endif
static struct platform_driver gpio_decoder_driver = {
.probe = gpio_decoder_probe,
.driver = {
.name = "gpio-decoder",
- .of_match_table = of_match_ptr(gpio_decoder_of_match),
+ .of_match_table = gpio_decoder_of_match,
}
};
module_platform_driver(gpio_decoder_driver);
diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c
index 4581f1c53644..f69de9762c4e 100644
--- a/drivers/input/misc/ims-pcu.c
+++ b/drivers/input/misc/ims-pcu.c
@@ -286,7 +286,7 @@ static int ims_pcu_setup_gamepad(struct ims_pcu *pcu)
struct input_dev *input;
int error;
- gamepad = kzalloc(sizeof(*gamepad), GFP_KERNEL);
+ gamepad = kzalloc_obj(*gamepad);
input = input_allocate_device();
if (!gamepad || !input) {
dev_err(pcu->dev,
@@ -1991,7 +1991,7 @@ static int ims_pcu_probe(struct usb_interface *intf,
struct ims_pcu *pcu;
int error;
- pcu = kzalloc(sizeof(*pcu), GFP_KERNEL);
+ pcu = kzalloc_obj(*pcu);
if (!pcu)
return -ENOMEM;
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
index bee4b1376491..152633bd2266 100644
--- a/drivers/input/misc/keyspan_remote.c
+++ b/drivers/input/misc/keyspan_remote.c
@@ -453,7 +453,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
if (!endpoint)
return -ENODEV;
- remote = kzalloc(sizeof(*remote), GFP_KERNEL);
+ remote = kzalloc_obj(*remote);
input_dev = input_allocate_device();
if (!remote || !input_dev) {
error = -ENOMEM;
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index d5e051a25a74..975c3ba023f5 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -247,7 +247,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
return -EINVAL;
}
- chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+ chip = kzalloc_obj(*chip);
input_dev = input_allocate_device();
if (!chip || !input_dev) {
dev_err(&pdev->dev, "unable to allocate memory\n");
diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c
index b83d762ae2e9..cb781ce967ca 100644
--- a/drivers/input/misc/mc13783-pwrbutton.c
+++ b/drivers/input/misc/mc13783-pwrbutton.c
@@ -108,7 +108,7 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
return -ENOMEM;
}
- priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+ priv = kzalloc_obj(*priv);
if (!priv) {
err = -ENOMEM;
dev_dbg(&pdev->dev, "Can't allocate power button\n");
diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c
index 39fc451c56e9..f22083f44d91 100644
--- a/drivers/input/misc/palmas-pwrbutton.c
+++ b/drivers/input/misc/palmas-pwrbutton.c
@@ -91,7 +91,7 @@ static irqreturn_t pwron_irq(int irq, void *palmas_pwron)
pm_wakeup_event(input_dev->dev.parent, 0);
input_sync(input_dev);
- mod_delayed_work(system_wq, &pwron->input_work,
+ mod_delayed_work(system_dfl_wq, &pwron->input_work,
msecs_to_jiffies(PALMAS_PWR_KEY_Q_TIME_MS));
return IRQ_HANDLED;
@@ -164,7 +164,7 @@ static int palmas_pwron_probe(struct platform_device *pdev)
palmas_pwron_params_ofinit(dev, &config);
- pwron = kzalloc(sizeof(*pwron), GFP_KERNEL);
+ pwron = kzalloc_obj(*pwron);
if (!pwron)
return -ENOMEM;
diff --git a/drivers/input/misc/pcap_keys.c b/drivers/input/misc/pcap_keys.c
index fe43fd72ba7b..b19899b50d0b 100644
--- a/drivers/input/misc/pcap_keys.c
+++ b/drivers/input/misc/pcap_keys.c
@@ -49,7 +49,7 @@ static int pcap_keys_probe(struct platform_device *pdev)
struct pcap_keys *pcap_keys;
struct input_dev *input_dev;
- pcap_keys = kmalloc(sizeof(*pcap_keys), GFP_KERNEL);
+ pcap_keys = kmalloc_obj(*pcap_keys);
if (!pcap_keys)
return err;
diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c
index 3632cb206e34..14fc6c6cf699 100644
--- a/drivers/input/misc/pcf8574_keypad.c
+++ b/drivers/input/misc/pcf8574_keypad.c
@@ -91,7 +91,7 @@ static int pcf8574_kp_probe(struct i2c_client *client)
return -ENODEV;
}
- lp = kzalloc(sizeof(*lp), GFP_KERNEL);
+ lp = kzalloc_obj(*lp);
if (!lp)
return -ENOMEM;
diff --git a/drivers/input/misc/pf1550-onkey.c b/drivers/input/misc/pf1550-onkey.c
index 9be6377151cb..0d1b570bbe47 100644
--- a/drivers/input/misc/pf1550-onkey.c
+++ b/drivers/input/misc/pf1550-onkey.c
@@ -173,7 +173,7 @@ static int pf1550_onkey_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(pf1550_onkey_pm_ops, pf1550_onkey_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(pf1550_onkey_pm_ops, pf1550_onkey_suspend,
pf1550_onkey_resume);
static const struct platform_device_id pf1550_onkey_id[] = {
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index ecb92ee5ebbc..754379d2625c 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -275,7 +275,7 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev
if (!pm->data)
return -1;
- pm->configcr = kmalloc(sizeof(*(pm->configcr)), GFP_KERNEL);
+ pm->configcr = kmalloc_obj(*(pm->configcr));
if (!pm->configcr)
return -ENOMEM;
@@ -313,7 +313,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
0, interface->desc.bInterfaceNumber, NULL, 0,
USB_CTRL_SET_TIMEOUT);
- pm = kzalloc(sizeof(*pm), GFP_KERNEL);
+ pm = kzalloc_obj(*pm);
input_dev = input_allocate_device();
if (!pm || !input_dev)
goto fail1;
diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c
index f85cc289c053..b0feef19515d 100644
--- a/drivers/input/misc/twl4030-pwrbutton.c
+++ b/drivers/input/misc/twl4030-pwrbutton.c
@@ -20,27 +20,43 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <linux/bits.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/input.h>
#include <linux/interrupt.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
#include <linux/platform_device.h>
#include <linux/mfd/twl.h>
-#define PWR_PWRON_IRQ (1 << 0)
+#define PWR_PWRON_IRQ BIT(0)
-#define STS_HW_CONDITIONS 0xf
+struct twl_pwrbutton_chipdata {
+ u8 status_reg;
+ bool need_manual_irq;
+};
+
+static const struct twl_pwrbutton_chipdata twl4030_chipdata = {
+ .status_reg = 0xf,
+ .need_manual_irq = false,
+};
+
+static const struct twl_pwrbutton_chipdata twl6030_chipdata = {
+ .status_reg = 0x2,
+ .need_manual_irq = true,
+};
static irqreturn_t powerbutton_irq(int irq, void *_pwr)
{
struct input_dev *pwr = _pwr;
+ const struct twl_pwrbutton_chipdata *pdata = dev_get_drvdata(pwr->dev.parent);
int err;
u8 value;
- err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &value, STS_HW_CONDITIONS);
+ err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &value, pdata->status_reg);
if (!err) {
pm_wakeup_event(pwr->dev.parent, 0);
input_report_key(pwr, KEY_POWER, value & PWR_PWRON_IRQ);
@@ -55,10 +71,17 @@ static irqreturn_t powerbutton_irq(int irq, void *_pwr)
static int twl4030_pwrbutton_probe(struct platform_device *pdev)
{
+ const struct twl_pwrbutton_chipdata *pdata;
struct input_dev *pwr;
int irq = platform_get_irq(pdev, 0);
int err;
+ pdata = device_get_match_data(&pdev->dev);
+ if (!pdata)
+ return -EINVAL;
+
+ platform_set_drvdata(pdev, (void *)pdata);
+
pwr = devm_input_allocate_device(&pdev->dev);
if (!pwr) {
dev_err(&pdev->dev, "Can't allocate power button\n");
@@ -85,24 +108,50 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev)
return err;
}
+ if (pdata->need_manual_irq) {
+ err = twl6030_interrupt_unmask(0x01, REG_INT_MSK_LINE_A);
+ if (err)
+ return err;
+
+ err = twl6030_interrupt_unmask(0x01, REG_INT_MSK_STS_A);
+ if (err)
+ return err;
+ }
+
device_init_wakeup(&pdev->dev, true);
return 0;
}
-#ifdef CONFIG_OF
+static void twl4030_pwrbutton_remove(struct platform_device *pdev)
+{
+ const struct twl_pwrbutton_chipdata *pdata = platform_get_drvdata(pdev);
+
+ if (pdata->need_manual_irq) {
+ twl6030_interrupt_mask(0x01, REG_INT_MSK_LINE_A);
+ twl6030_interrupt_mask(0x01, REG_INT_MSK_STS_A);
+ }
+}
+
static const struct of_device_id twl4030_pwrbutton_dt_match_table[] = {
- { .compatible = "ti,twl4030-pwrbutton" },
- {},
+ {
+ .compatible = "ti,twl4030-pwrbutton",
+ .data = &twl4030_chipdata,
+ },
+ {
+ .compatible = "ti,twl6030-pwrbutton",
+ .data = &twl6030_chipdata,
+ },
+ { }
};
MODULE_DEVICE_TABLE(of, twl4030_pwrbutton_dt_match_table);
-#endif
static struct platform_driver twl4030_pwrbutton_driver = {
.probe = twl4030_pwrbutton_probe,
+ .remove = twl4030_pwrbutton_remove,
.driver = {
.name = "twl4030_pwrbutton",
- .of_match_table = of_match_ptr(twl4030_pwrbutton_dt_match_table),
+ .of_match_table = twl4030_pwrbutton_dt_match_table,
},
};
module_platform_driver(twl4030_pwrbutton_driver);
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 13336a2fd49c..e589060db280 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -379,7 +379,7 @@ static int uinput_open(struct inode *inode, struct file *file)
{
struct uinput_device *newdev;
- newdev = kzalloc(sizeof(*newdev), GFP_KERNEL);
+ newdev = kzalloc_obj(*newdev);
if (!newdev)
return -ENOMEM;
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
index 67f1c7364c95..6471d836f6fe 100644
--- a/drivers/input/misc/xen-kbdfront.c
+++ b/drivers/input/misc/xen-kbdfront.c
@@ -205,7 +205,7 @@ static int xenkbd_probe(struct xenbus_device *dev,
struct xenkbd_info *info;
struct input_dev *kbd, *ptr, *mtouch;
- info = kzalloc(sizeof(*info), GFP_KERNEL);
+ info = kzalloc_obj(*info);
if (!info) {
xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure");
return -ENOMEM;
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c
index 08dc53ae1b3c..8786ed8b3565 100644
--- a/drivers/input/misc/yealink.c
+++ b/drivers/input/misc/yealink.c
@@ -831,7 +831,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
if (!usb_endpoint_is_int_in(endpoint))
return -ENODEV;
- yld = kzalloc(sizeof(*yld), GFP_KERNEL);
+ yld = kzalloc_obj(*yld);
if (!yld)
return -ENOMEM;
@@ -854,7 +854,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
if (!yld->ctl_data)
return usb_cleanup(yld, -ENOMEM);
- yld->ctl_req = kmalloc(sizeof(*(yld->ctl_req)), GFP_KERNEL);
+ yld->ctl_req = kmalloc_obj(*(yld->ctl_req));
if (yld->ctl_req == NULL)
return usb_cleanup(yld, -ENOMEM);