efirtc: remove unnecessary code efi_rtc_open & efi_rtc_close

This change “efirtc: remove unnecessary code efi_rtc_open & efi_rtc_close” in Linux kernel is authored by Naveen Kumar Parna <parna.naveenkumar [at] gmail.com> on Tue Jan 22 13:55:10 2019 +0530.

efirtc: remove unnecessary code efi_rtc_open & efi_rtc_close

There is no advantage to keep 'struct file_operations.open & .close'
API's. So removed the unnecessary code efi_rtc_open & efi_rtc_close.

Signed-off-by: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit db6e863.

There are 23 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/char/efirtc.c | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
index d9aab64..11781eb 100644
--- a/drivers/char/efirtc.c
+++ b/drivers/char/efirtc.c
@@ -255,35 +255,12 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
 }
 
 /*
- *	We enforce only one user at a time here with the open/close.
- *	Also clear the previous interrupt data on an open, and clean
- *	up things on a close.
- */
-
-static int efi_rtc_open(struct inode *inode, struct file *file)
-{
-	/*
-	 * nothing special to do here
-	 * We do accept multiple open files at the same time as we
-	 * synchronize on the per call operation.
-	 */
-	return 0;
-}
-
-static int efi_rtc_close(struct inode *inode, struct file *file)
-{
-	return 0;
-}
-
-/*
  *	The various file operations we support.
  */
 
 static const struct file_operations efi_rtc_fops = {
 	.owner		= THIS_MODULE,
 	.unlocked_ioctl	= efi_rtc_ioctl,
-	.open		= efi_rtc_open,
-	.release	= efi_rtc_close,
 	.llseek		= no_llseek,
 };
 

The commit for this change in Linux stable tree is db6e863 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *