From: phucduc.bui@gmail.com
To: Bartosz Golaszewski <brgl@kernel.org>,
Kent Gibson <warthog618@gmail.com>
Cc: Linus Walleij <linusw@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH] gpio: cdev: Drop redundant nonseekable_open() return check
Date: Fri, 3 Jul 2026 09:09:46 +0700 [thread overview]
Message-ID: <20260703020947.8010-1-phucduc.bui@gmail.com> (raw)
From: bui duc phuc <phucduc.bui@gmail.com>
nonseekable_open() never fails, so the error check is unnecessary.
Remove the dead error handling path.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/gpio/gpiolib-cdev.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
index 82f27db0b230..9f3b628d5793 100644
--- a/drivers/gpio/gpiolib-cdev.c
+++ b/drivers/gpio/gpiolib-cdev.c
@@ -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,
--
2.43.0
reply other threads:[~2026-07-03 2:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260703020947.8010-1-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=brgl@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=warthog618@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox