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

Configure Feed

Select the types of activity you want to include in your feed.

Input: ili210x - use guard notation when disabling and reenabling IRQ

This makes the code more compact and error handling more robust.

Link: https://lore.kernel.org/r/20240609234757.610273-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+7 -9
+7 -9
drivers/input/touchscreen/ili210x.c
··· 860 860 * the touch controller to disable the IRQs during update, so we have 861 861 * to do it this way here. 862 862 */ 863 - disable_irq(client->irq); 863 + scoped_guard(disable_irq, &client->irq) { 864 + dev_dbg(dev, "Firmware update started, firmware=%s\n", fwname); 864 865 865 - dev_dbg(dev, "Firmware update started, firmware=%s\n", fwname); 866 + ili210x_hardware_reset(priv->reset_gpio); 866 867 867 - ili210x_hardware_reset(priv->reset_gpio); 868 + error = ili210x_do_firmware_update(priv, fwbuf, ac_end, df_end); 868 869 869 - error = ili210x_do_firmware_update(priv, fwbuf, ac_end, df_end); 870 + ili210x_hardware_reset(priv->reset_gpio); 870 871 871 - ili210x_hardware_reset(priv->reset_gpio); 872 - 873 - dev_dbg(dev, "Firmware update ended, error=%i\n", error); 874 - 875 - enable_irq(client->irq); 872 + dev_dbg(dev, "Firmware update ended, error=%i\n", error); 873 + } 876 874 877 875 return error ?: count; 878 876 }