drivers: remove unimplemented open/close/ioctl interfaces

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko
2022-04-12 12:16:13 +02:00
committed by Xiang Xiao
parent 6041a2f0db
commit 09b3fb25ab
96 changed files with 346 additions and 1991 deletions
+2 -30
View File
@@ -77,8 +77,6 @@ static int charger_online(FAR bool *online);
static int charger_get_temptable(FAR struct battery_temp_table_s *table);
static int charger_set_temptable(FAR struct battery_temp_table_s *table);
static int charger_open(FAR struct file *filep);
static int charger_close(FAR struct file *filep);
static ssize_t charger_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t charger_write(FAR struct file *filep,
@@ -92,8 +90,8 @@ static int charger_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_chargerops =
{
charger_open, /* open */
charger_close, /* close */
NULL, /* open */
NULL, /* close */
charger_read, /* read */
charger_write, /* write */
NULL, /* seek */
@@ -419,32 +417,6 @@ static int charger_set_temptable(FAR struct battery_temp_table_s *table)
return cxd56_pmic_settemptable(&buf);
}
/****************************************************************************
* Name: charger_open
*
* Description:
* This function is called whenever the battery device is opened.
*
****************************************************************************/
static int charger_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: charger_close
*
* Description:
* This routine is called when the battery device is closed.
*
****************************************************************************/
static int charger_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: charger_read
****************************************************************************/
+3 -31
View File
@@ -62,14 +62,12 @@ struct bat_gauge_dev_s
* Private Function Prototypes
****************************************************************************/
static int gauge_open(FAR struct file *filep);
static int gauge_close(FAR struct file *filep);
static ssize_t gauge_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t gauge_write(FAR struct file *filep,
FAR const char *buffer, size_t buflen);
static int gauge_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
unsigned long arg);
/****************************************************************************
* Private Data
@@ -77,8 +75,8 @@ static int gauge_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_gaugeops =
{
gauge_open, /* open */
gauge_close, /* close */
NULL, /* open */
NULL, /* close */
gauge_read, /* read */
gauge_write, /* write */
NULL, /* seek */
@@ -247,32 +245,6 @@ static int gauge_online(FAR bool *online)
return OK;
}
/****************************************************************************
* Name: gauge_open
*
* Description:
* This function is called whenever the battery device is opened.
*
****************************************************************************/
static int gauge_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: gauge_close
*
* Description:
* This routine is called when the battery device is closed.
*
****************************************************************************/
static int gauge_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: gauge_read
****************************************************************************/
+2 -26
View File
@@ -46,8 +46,6 @@
* Private Function Prototypes
****************************************************************************/
static int ge2d_open(FAR struct file *filep);
static int ge2d_close(FAR struct file *filep);
static ssize_t ge2d_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static ssize_t ge2d_write(FAR struct file *filep, FAR const char *buffer,
@@ -63,12 +61,9 @@ static int ge2d_irqhandler(int irq, FAR void *context, FAR void *arg);
static const struct file_operations g_ge2dfops =
{
.open = ge2d_open,
.close = ge2d_close,
.read = ge2d_read,
.write = ge2d_write,
.seek = NULL,
.ioctl = ge2d_ioctl,
.ioctl = ge2d_ioctl
};
static sem_t g_wait;
@@ -96,24 +91,6 @@ static void ge2d_semgive(sem_t *id)
nxsem_post(id);
}
/****************************************************************************
* Name: ge2d_open
****************************************************************************/
static int ge2d_open(FAR struct file *filep)
{
return 0;
}
/****************************************************************************
* Name: ge2d_close
****************************************************************************/
static int ge2d_close(FAR struct file *filep)
{
return 0;
}
/****************************************************************************
* Name: ge2d_read
****************************************************************************/
@@ -129,8 +106,7 @@ static ssize_t ge2d_read(FAR struct file *filep,
* Name: ge2d_write
****************************************************************************/
static ssize_t ge2d_write(FAR struct file *filep,
FAR const char *buffer,
static ssize_t ge2d_write(FAR struct file *filep, FAR const char *buffer,
size_t len)
{
uint32_t bits;
+2 -46
View File
@@ -68,8 +68,6 @@ struct cxd56_geofence_dev_s
/* file operation functions */
static int cxd56_geofence_open(FAR struct file *filep);
static int cxd56_geofence_close(FAR struct file *filep);
static ssize_t cxd56_geofence_read(FAR struct file *filep,
FAR char *buffer,
size_t len);
@@ -101,8 +99,8 @@ static int cxd56_geofence_set_mode(unsigned long arg);
static const struct file_operations g_geofencefops =
{
cxd56_geofence_open, /* open */
cxd56_geofence_close, /* close */
NULL, /* open */
NULL, /* close */
cxd56_geofence_read, /* read */
NULL, /* write */
NULL, /* seek */
@@ -478,48 +476,6 @@ static int cxd56_geofence_initialize(FAR struct cxd56_geofence_dev_s *dev)
return ret;
}
/****************************************************************************
* Name: cxd56_geofence_open
*
* Description:
* Standard character driver open method.
*
* Input Parameters:
* filep - File structure pointer
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
static int cxd56_geofence_open(FAR struct file *filep)
{
int32_t ret = 0;
return ret;
}
/****************************************************************************
* Name: cxd56_geofence_close
*
* Description:
* Standard character driver close method.
*
* Input Parameters:
* filep - File structure pointer
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
static int cxd56_geofence_close(FAR struct file *filep)
{
int32_t ret = 0;
return ret;
}
/****************************************************************************
* Name: cxd56_geofence_read
*
-2
View File
@@ -2438,8 +2438,6 @@ static void cxd56_gnss_cpufifoapi_signalhandler(uint32_t data,
priv->apiret = CXD56_CPU1_GET_DATA((int)data);
nxsem_post(&priv->apiwait);
return;
}
/****************************************************************************
+6 -2
View File
@@ -141,8 +141,10 @@ static const struct file_operations g_hif_fops =
hif_write, /* write */
hif_seek, /* seek */
hif_ioctl, /* ioctl */
hif_poll, /* poll */
hif_unlink /* unlink */
hif_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, hif_unlink /* unlink */
#endif
};
/****************************************************************************
@@ -343,10 +345,12 @@ static int hif_poll(FAR struct file *filep,
return OK;
}
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
static int hif_unlink(FAR struct inode *inode)
{
return OK;
}
#endif
static int hif_rxhandler(int cpuid, int protoid,
uint32_t pdata, uint32_t data,
+1 -5
View File
@@ -92,11 +92,7 @@ static int cxd56_sphirqhandler(int irq, FAR void *context, FAR void *arg);
static const struct file_operations sph_fops =
{
.open = sph_open,
.close = NULL,
.read = NULL,
.write = NULL,
.seek = NULL,
.ioctl = sph_ioctl,
.ioctl = sph_ioctl
};
static struct sph_dev_s g_sphdev[NR_HSEMS];
+1 -1
View File
@@ -73,7 +73,7 @@ static int g_errcode = 0;
static const struct file_operations g_sysctlfops =
{
.ioctl = sysctl_ioctl,
.ioctl = sysctl_ioctl
};
/****************************************************************************
+1 -13
View File
@@ -72,7 +72,6 @@ static ssize_t uart0_read(FAR struct file *filep,
FAR char *buffer, size_t len);
static ssize_t uart0_write(FAR struct file *filep,
FAR const char *buffer, size_t len);
static int uart0_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static int uart0_semtake(sem_t *id);
static void uart0_semgive(sem_t *id);
@@ -98,9 +97,7 @@ static const struct file_operations g_uart0fops =
.open = uart0_open,
.close = uart0_close,
.read = uart0_read,
.write = uart0_write,
.seek = NULL,
.ioctl = uart0_ioctl,
.write = uart0_write
};
static sem_t g_lock;
@@ -251,15 +248,6 @@ static ssize_t uart0_write(FAR struct file *filep,
return (ssize_t)ret;
}
/****************************************************************************
* Name: uart0_ioctl
****************************************************************************/
static int uart0_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
return -ENOTTY;
}
/****************************************************************************
* Name: cxd56_uart0initialize
****************************************************************************/
+8 -37
View File
@@ -52,8 +52,6 @@
* Private Function Prototypes
****************************************************************************/
static int phyplus_stub_open(FAR struct file *filep);
static int phyplus_stub_close(FAR struct file *filep);
static ssize_t phyplus_stub_read(
FAR struct file *filep, FAR char *buffer, size_t buflen);
static ssize_t phyplus_stub_write(
@@ -70,15 +68,15 @@ static int phyplus_stub_ioctl(
static const struct file_operations g_stub_drvrops =
{
phyplus_stub_open, /* open */
phyplus_stub_close, /* close */
NULL, /* open */
NULL, /* close */
phyplus_stub_read, /* read */
phyplus_stub_write, /* write */
phyplus_stub_seek, /* seek */
phyplus_stub_ioctl, /* ioctl */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
, NULL /* unlink */
#endif
};
@@ -566,33 +564,6 @@ static int phyplus_parse_params_and_action(char *buff)
return 0;
}
/****************************************************************************
* Name: phyplus_stub_open
*
* Description:
* Standard character driver open method.
*
****************************************************************************/
static int phyplus_stub_open(FAR struct file *filep)
{
filep->f_pos = 0;
return OK;
}
/****************************************************************************
* Name: phyplus_stub_close
*
* Description:
* Standard character driver close method.
*
****************************************************************************/
static int phyplus_stub_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: phyplus_gpio_read
*
@@ -633,7 +604,7 @@ static ssize_t phyplus_stub_read(
static char phyplus_cmd[CMD_LEN];
static ssize_t phyplus_stub_write(FAR struct file *filep,
FAR const char *buffer, size_t buflen)
FAR const char *buffer, size_t buflen)
{
FAR struct inode *inode;
@@ -686,8 +657,8 @@ static ssize_t phyplus_stub_write(FAR struct file *filep,
*
****************************************************************************/
static off_t phyplus_stub_seek(FAR struct file *filep,
off_t offset, int whence)
static off_t phyplus_stub_seek(FAR struct file *filep, off_t offset,
int whence)
{
/* Only SEEK_SET is supported, return ENOSYS for other valid options */
@@ -717,8 +688,8 @@ static off_t phyplus_stub_seek(FAR struct file *filep,
*
****************************************************************************/
static int phyplus_stub_ioctl(FAR struct file *filep,
int cmd, unsigned long arg)
static int phyplus_stub_ioctl(FAR struct file *filep, int cmd,
unsigned long arg)
{
FAR struct inode *inode;
int ret = 0;
+1 -1
View File
@@ -26,7 +26,7 @@
#include <fcntl.h>
#include <nuttx/serial/serial.h>
#include <nuttx/net/netdev.h>
#include <../../../../net/netdev/netdev.h>
#include <nuttx/net/netdev/netdev.h>
#include "amebaz_hci_board.h"
/****************************************************************************
+1 -1
View File
@@ -1675,7 +1675,7 @@ int sam_tsd_register(struct sam_adc_s *adc, int minor)
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &g_tsdops, 0666, priv);
+1 -1
View File
@@ -140,7 +140,7 @@ static const struct file_operations stm32_bbsram_fops =
.ioctl = stm32_bbsram_ioctl,
.poll = stm32_bbsram_poll,
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
.unlink = stm32_bbsram_unlink,
.unlink = stm32_bbsram_unlink
#endif
};
+1 -1
View File
@@ -140,7 +140,7 @@ static const struct file_operations stm32_bbsram_fops =
.ioctl = stm32_bbsram_ioctl,
.poll = stm32_bbsram_poll,
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
.unlink = stm32_bbsram_unlink,
.unlink = stm32_bbsram_unlink
#endif
};
+1 -1
View File
@@ -161,7 +161,7 @@ static const struct file_operations stm32_bbsram_fops =
.ioctl = stm32_bbsram_ioctl,
.poll = stm32_bbsram_poll,
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
.unlink = stm32_bbsram_unlink,
.unlink = stm32_bbsram_unlink
#endif
};
+1 -1
View File
@@ -135,7 +135,7 @@ static const struct file_operations rx65n_sbram_fops =
.ioctl = rx65n_sbram_ioctl,
.poll = rx65n_sbram_poll,
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
.unlink = rx65n_sbram_unlink,
.unlink = rx65n_sbram_unlink
#endif
};
+2 -2
View File
@@ -115,7 +115,7 @@ int sim_tsc_initialize(int minor)
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = touch_register(&priv->lower, devname, 1);
@@ -162,7 +162,7 @@ int sim_tsc_uninitialize(void)
/* Un-register the device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, priv->minor);
iinfo("Un-registering %s\n", devname);
touch_unregister(&priv->lower, devname);
+8 -20
View File
@@ -203,8 +203,6 @@ typedef enum
* Private Function Prototypes
****************************************************************************/
static int keypad_open(struct file *filep);
static int keypad_close(struct file *filep);
static ssize_t keypad_read(struct file *filep, FAR char *buf, size_t buflen);
/****************************************************************************
@@ -253,15 +251,15 @@ static const unsigned char g_kdbus[128] =
static const struct file_operations g_keypadops =
{
keypad_open, /* open */
keypad_close, /* close */
keypad_read, /* read */
NULL, /* write */
NULL, /* seek */
NULL, /* ioctl */
NULL /* poll */
NULL, /* open */
NULL, /* close */
keypad_read, /* read */
NULL, /* write */
NULL, /* seek */
NULL, /* ioctl */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
, NULL /* unlink */
#endif
};
@@ -269,16 +267,6 @@ static const struct file_operations g_keypadops =
* Private Functions
****************************************************************************/
static int keypad_open(struct file *filep)
{
return OK;
}
static int keypad_close(struct file *filep)
{
return OK;
}
static ssize_t keypad_read(struct file *filep, FAR char *buf, size_t buflen)
{
uint_fast8_t keycode = 0;
+12 -24
View File
@@ -109,11 +109,9 @@ static int vga_getpower(struct lcd_dev_s *dev);
static int vga_setpower(struct lcd_dev_s *dev, int power);
static int vga_getcontrast(struct lcd_dev_s *dev);
static int vga_setcontrast(struct lcd_dev_s *dev, unsigned int contrast);
static int vga_open(struct file *filep);
static int vga_close(struct file *filep);
static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen);
static ssize_t vga_write(struct file *filep,
FAR const char *buf, size_t buflen);
static ssize_t vga_write(struct file *filep, FAR const char *buf,
size_t buflen);
static off_t vga_seek(FAR struct file *filp, off_t offset, int whence);
/****************************************************************************
@@ -233,15 +231,15 @@ static struct lcd_dev_s g_lcddev =
static const struct file_operations g_vgaops =
{
vga_open, /* open */
vga_close, /* close */
vga_read, /* read */
vga_write, /* write */
vga_seek, /* seek */
NULL, /* ioctl */
NULL /* poll */
NULL, /* open */
NULL, /* close */
vga_read, /* read */
vga_write, /* write */
vga_seek, /* seek */
NULL, /* ioctl */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
, NULL /* unlink */
#endif
};
@@ -472,16 +470,6 @@ static int vga_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
return -ENOSYS;
}
static int vga_open(struct file * filep)
{
return OK;
}
static int vga_close(struct file * filep)
{
return OK;
}
static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen)
{
if (buf == NULL || buflen < 1)
@@ -494,8 +482,8 @@ static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen)
return buflen;
}
static ssize_t vga_write(struct file *filep,
FAR const char *buf, size_t buflen)
static ssize_t vga_write(struct file *filep, FAR const char *buf,
size_t buflen)
{
int i;
int j;
+3 -31
View File
@@ -103,8 +103,6 @@
/* Character driver methods */
static int himem_open(struct file *filep);
static int himem_close(struct file *filep);
static ssize_t himem_read(struct file *filep, char *buffer,
size_t buflen);
static ssize_t himem_write(struct file *filep, const char *buffer,
@@ -151,8 +149,8 @@ irqstate_t spinlock_flags;
static const struct file_operations g_himemfops =
{
himem_open, /* open */
himem_close, /* close */
NULL, /* open */
NULL, /* close */
himem_read, /* read */
himem_write, /* write */
NULL, /* seek */
@@ -647,32 +645,6 @@ int esp_himem_unmap(esp_himem_rangehandle_t range, void *ptr,
return OK;
}
/****************************************************************************
* Name: himem_open
*
* Description:
* This function is called whenever the LM-75 device is opened.
*
****************************************************************************/
static int himem_open(struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: himem_close
*
* Description:
* This routine is called when the LM-75 device is closed.
*
****************************************************************************/
static int himem_close(struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: himem_read
****************************************************************************/
@@ -699,7 +671,7 @@ static ssize_t himem_write(struct file *filep, const char *buffer,
static int himem_ioctl(struct file *filep, int cmd, unsigned long arg)
{
int ret = OK;
int ret = OK;
switch (cmd)
{