Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] media: st-rc: remove misuse of IRQF_NO_SUSPEND flag

The device is set as wakeup capable using proper wakeup API but the
driver misuses IRQF_NO_SUSPEND to set the interrupt as wakeup source
which is incorrect.

This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
enable_irq_wake instead.

Cc: Srinivas Kandagatla <srinivas.kandagatla@gmail.com>
Cc: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: kernel@stlinux.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Sudeep Holla and committed by
Mauro Carvalho Chehab
a2d1e1ed 203e942d

+9 -5
+9 -5
drivers/media/rc/st_rc.c
··· 16 16 #include <linux/reset.h> 17 17 #include <media/rc-core.h> 18 18 #include <linux/pinctrl/consumer.h> 19 + #include <linux/pm_wakeirq.h> 19 20 20 21 struct st_rc_device { 21 22 struct device *dev; ··· 191 190 static int st_rc_remove(struct platform_device *pdev) 192 191 { 193 192 struct st_rc_device *rc_dev = platform_get_drvdata(pdev); 193 + 194 + dev_pm_clear_wake_irq(&pdev->dev); 195 + device_init_wakeup(&pdev->dev, false); 194 196 clk_disable_unprepare(rc_dev->sys_clock); 195 197 rc_unregister_device(rc_dev->rdev); 196 198 return 0; ··· 302 298 rdev->map_name = RC_MAP_LIRC; 303 299 rdev->input_name = "ST Remote Control Receiver"; 304 300 305 - /* enable wake via this device */ 306 - device_set_wakeup_capable(dev, true); 307 - device_set_wakeup_enable(dev, true); 308 - 309 301 ret = rc_register_device(rdev); 310 302 if (ret < 0) 311 303 goto clkerr; 312 304 313 305 rc_dev->rdev = rdev; 314 306 if (devm_request_irq(dev, rc_dev->irq, st_rc_rx_interrupt, 315 - IRQF_NO_SUSPEND, IR_ST_NAME, rc_dev) < 0) { 307 + 0, IR_ST_NAME, rc_dev) < 0) { 316 308 dev_err(dev, "IRQ %d register failed\n", rc_dev->irq); 317 309 ret = -EINVAL; 318 310 goto rcerr; 319 311 } 312 + 313 + /* enable wake via this device */ 314 + device_init_wakeup(dev, true); 315 + dev_pm_set_wake_irq(dev, rc_dev->irq); 320 316 321 317 /** 322 318 * for LIRC_MODE_MODE2 or LIRC_MODE_PULSE or LIRC_MODE_RAW