Commit 7c459517 authored by Dmitry Torokhov's avatar Dmitry Torokhov

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.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent ac7e0839
...@@ -860,8 +860,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev, ...@@ -860,8 +860,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev,
* the touch controller to disable the IRQs during update, so we have * the touch controller to disable the IRQs during update, so we have
* to do it this way here. * to do it this way here.
*/ */
disable_irq(client->irq); scoped_guard(disable_irq, &client->irq) {
dev_dbg(dev, "Firmware update started, firmware=%s\n", fwname); dev_dbg(dev, "Firmware update started, firmware=%s\n", fwname);
ili210x_hardware_reset(priv->reset_gpio); ili210x_hardware_reset(priv->reset_gpio);
...@@ -871,8 +870,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev, ...@@ -871,8 +870,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev,
ili210x_hardware_reset(priv->reset_gpio); ili210x_hardware_reset(priv->reset_gpio);
dev_dbg(dev, "Firmware update ended, error=%i\n", error); dev_dbg(dev, "Firmware update ended, error=%i\n", error);
}
enable_irq(client->irq);
return error ?: count; return error ?: count;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment