serial: 8250_pnp: Simplify "line" related code
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 6 May 2024 12:12:02 +0000 (15:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 May 2024 10:49:12 +0000 (11:49 +0100)
commitabe7015a3630f80037d9e40347d31a8d1f95428a
tree8ac18f17d384965354e789fb4ffe0a639c5c1612
parentae1b6b4c0a0c93a53cb897e54c84079a017cd9d0
serial: 8250_pnp: Simplify "line" related code

8250_pnp sets drvdata to line + 1 if the probe is successful. The users
of drvdata are in remove, suspend and resume callbacks, none of which
will be called if probe failed. The line acquired from drvdata can
never be zero in those functions and the checks for that can be
removed.

Eliminate also +/-1 step because all users of line subtract 1 from the
value.

These might have been leftover from legacy PM callbacks that could
be called without probe being successful.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240506121202.11253-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_pnp.c