Skip to contentSkip to conversation

gpio: cdev: Drop redundant nonseekable_open() return check

PATCH Applied [email protected] 2 participants 2 messages Jul 3 – Jul 6

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: cdev: Drop redundant nonseekable_open() return check

From: bui duc phuc <[email protected]>

nonseekable_open() never fails, so the error check is unnecessary. Remove the dead error handling path.

---
 drivers/gpio/gpiolib-cdev.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/gpio/gpiolib-cdev.c +1 -8
index 82f27db0b230..9f3b628d5793 100644
@@ -2682,15 +2682,8 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file)
 	file->private_data = cdev;
 	cdev->fp = file;
 
-	ret = nonseekable_open(inode, file);
-	if (ret)
-		goto out_unregister_device_notifier;
-
-	return ret;
+	return nonseekable_open(inode, file);
 
-out_unregister_device_notifier:
-	blocking_notifier_chain_unregister(&gdev->device_notifier,
-					   &cdev->device_unregistered_nb);
 out_unregister_line_notifier:
 	scoped_guard(write_lock_irqsave, &gdev->line_state_lock)
 		raw_notifier_chain_unregister(&gdev->line_state_notifier,
Signature · 1 line
2.43.0