Skip to content

Commit

Permalink
serdev: Replace all instances of ENOTSUPP with EOPNOTSUPP
Browse files Browse the repository at this point in the history
This replaces all instances of ENOTSUPP with EOPNOTSUPP since ENOTSUPP
is not a standard error code. This will help maintain consistency in
error codes when new serdev API's are added.

Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Neeraj Sanjay Kale authored and Vudentz committed Apr 24, 2023
1 parent 586e154 commit 29f93a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions drivers/tty/serdev/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ int serdev_device_set_parity(struct serdev_device *serdev,
struct serdev_controller *ctrl = serdev->ctrl;

if (!ctrl || !ctrl->ops->set_parity)
return -ENOTSUPP;
return -EOPNOTSUPP;

return ctrl->ops->set_parity(ctrl, parity);
}
Expand All @@ -388,7 +388,7 @@ int serdev_device_get_tiocm(struct serdev_device *serdev)
struct serdev_controller *ctrl = serdev->ctrl;

if (!ctrl || !ctrl->ops->get_tiocm)
return -ENOTSUPP;
return -EOPNOTSUPP;

return ctrl->ops->get_tiocm(ctrl);
}
Expand All @@ -399,7 +399,7 @@ int serdev_device_set_tiocm(struct serdev_device *serdev, int set, int clear)
struct serdev_controller *ctrl = serdev->ctrl;

if (!ctrl || !ctrl->ops->set_tiocm)
return -ENOTSUPP;
return -EOPNOTSUPP;

return ctrl->ops->set_tiocm(ctrl, set, clear);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/tty/serdev/serdev-ttyport.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static int ttyport_get_tiocm(struct serdev_controller *ctrl)
struct tty_struct *tty = serport->tty;

if (!tty->ops->tiocmget)
return -ENOTSUPP;
return -EOPNOTSUPP;

return tty->ops->tiocmget(tty);
}
Expand All @@ -242,7 +242,7 @@ static int ttyport_set_tiocm(struct serdev_controller *ctrl, unsigned int set, u
struct tty_struct *tty = serport->tty;

if (!tty->ops->tiocmset)
return -ENOTSUPP;
return -EOPNOTSUPP;

return tty->ops->tiocmset(tty, set, clear);
}
Expand Down
4 changes: 2 additions & 2 deletions include/linux/serdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ static inline int serdev_device_write_buf(struct serdev_device *serdev,
static inline void serdev_device_wait_until_sent(struct serdev_device *sdev, long timeout) {}
static inline int serdev_device_get_tiocm(struct serdev_device *serdev)
{
return -ENOTSUPP;
return -EOPNOTSUPP;
}
static inline int serdev_device_set_tiocm(struct serdev_device *serdev, int set, int clear)
{
return -ENOTSUPP;
return -EOPNOTSUPP;
}
static inline int serdev_device_write(struct serdev_device *sdev, const unsigned char *buf,
size_t count, unsigned long timeout)
Expand Down

0 comments on commit 29f93a6

Please sign in to comment.