Commit Graph

14 Commits

Author SHA1 Message Date
Andy Shevchenko
c18bde8570 auxdisplay: arm-charlcd: Remove redundant ternary operators
For ternary operators in the form of a ? true : false, if a itself returns
a boolean result, the ternary operator can be omitted. Remove redundant
ternary operators to clean up the code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-12-29 14:52:19 +01:00
Andy Shevchenko
548d6800fa auxdisplay: arm-charlcd: Join string literals back
For easy grepping on debug purposes join string literals back in
the messages.

No functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-12-29 14:52:19 +01:00
Andy Shevchenko
b7eda5634e auxdisplay: arm-charlcd: Use readl_poll_timeout
Use readl_poll_timeout_atomic() from <iopoll.h> instead of using
custom poll loops.

The timeout settings are different, but that shouldn't be much of a
problem. Instead of polling 10 times in a close loop, it polls for
one millisecond.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-12-29 14:52:19 +01:00
Andy Shevchenko
de2248f7a4 auxdisplay: arm-charlcd: Don't use "proxy" headers
Update header inclusions to follow IWYU (Include What You Use) principle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-12-29 14:52:18 +01:00
Andy Shevchenko
c77851631c auxdisplay: arm-charlcd: drop of_match_ptr()
The general recommendation is to not use of_match_ptr(). Drop it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-12-29 14:52:18 +01:00
Andy Shevchenko
a8f4a4fb34 auxdisplay: arm-charlcd: Remove unneeded info message
When probe succeeds we have other means to check if it was successful,
no need to pollute kernel log with the practically duplicated info.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-12-29 14:27:56 +01:00
Andy Shevchenko
483d86cf4b auxdisplay: arm-charlcd: convert to use device managed APIs
The current probe function of the driver is implemented by using
plain old APIs. As Geert noted, one of the error paths has a mistake
that may lead to a wrong call. Instead of targeting that particular
issue, convert the driver to use device managed APIs altogether.
It's not needed per se (driver can never be removed once loaded),
but it simplifies coding and error handling.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/r/CAMuHMdVquNEoxRQkcBEH0nC+CDuib6o0H6m3CBk3ZN2267LpQw@mail.gmail.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-12-29 14:27:55 +01:00
Thomas Fourier
b5c23a4d29 auxdisplay: arm-charlcd: fix release_mem_region() size
It seems like, after the request_mem_region(), the corresponding
release_mem_region() must take the same size. This was done
in (now removed due to previous refactoring) charlcd_remove()
but not in the error path in charlcd_probe().

Fixes: ce8962455e ("ARM: 6214/2: driver for the character LCD found in ARM refdesigns")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-12-29 13:41:08 +01:00
Erick Archer
632691ad83 auxdisplay: Use sizeof(*pointer) instead of sizeof(type)
It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-06-04 10:29:36 +03:00
Alexander A. Klimov
46d4a403a0 auxdisplay: Replace HTTP links with HTTPS ones
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
    For each line:
      If doesn't contain `\bxmlns\b`:
        For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
	  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
            If both the HTTP and HTTPS versions
            return 200 OK and serve the same content:
              Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2020-08-08 16:10:03 +02:00
Wolfram Sang
ada953de44 auxdisplay: simplify getting .drvdata
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-08-01 18:58:09 +02:00
Miguel Ojeda
351f683b98 auxdisplay: Replace licenses with SPDX identifiers
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Acked-by: Willy Tarreau <w@1wt.eu>
Acked-by: Linus Walleij <triad@dflund.se>
Acked-by: Robin van der Gracht <robin@protonic.nl>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12 19:02:45 +02:00
Miguel Ojeda
b1bf6119dc auxdisplay: arm-charlcd: Fix struct charlcd doc line
There was a missing first line and a missing member,
which gave a warning under W=1:

    CC      drivers/auxdisplay/arm-charlcd.o
  drivers/auxdisplay/arm-charlcd.c:57: warning: Cannot understand
   * @dev: a pointer back to containing device on line 57 - I thought
  it was a doc line

Cc: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12 19:02:41 +02:00
Andy Shevchenko
00846a4425 auxdisplay: Move arm-charlcd.c to drivers/auxdisplay folder
It looks like arm-charlcd.c belongs to auxdisplay subsystem.

Move it to drivers/auxdisplay folder.
No functional changes intended.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08 17:48:20 +02:00