summaryrefslogtreecommitdiff
path: root/drivers/bus/bt1-apb.c
AgeCommit message (Collapse)Author
2020-05-28bus: bt1-apb: Use sysfs_streq instead of strncmpSerge Semin
There is a ready-to-use method to compare a retrieved from a sysfs node string with another string. It treats both NUL and newline-then-NUL as equivalent string terminations. So use it instead of manually truncating the line length in the strncmp() method. Link: https://lore.kernel.org/r/20200528145050.5203-4-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Olof Johansson <olof@lixom.net> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: soc@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-05-28bus: bt1-apb: Use PTR_ERR_OR_ZERO to return from request-regs methodSerge Semin
Indeed it's more optimal to use the PTR_ERR_OR_ZERO() macro there instead of having two return points. Link: https://lore.kernel.org/r/20200528145050.5203-3-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Olof Johansson <olof@lixom.net> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: soc@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-05-28bus: bt1-apb: Fix show/store callback identationsSerge Semin
After fixing the sysfs calback return value the functions argumnets identations have been left as before the fix. That made the argments declarations being unaligned with respect to the space surrounded by the parentheses. Link: https://lore.kernel.org/r/20200528145050.5203-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Olof Johansson <olof@lixom.net> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: soc@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-05-28bus: bt1-apb: Include linux/io.hSerge Semin
It must be included since we are using readl() method here. Link: https://lore.kernel.org/r/20200528145050.5203-1-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Olof Johansson <olof@lixom.net> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: soc@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-05-28bus: Add Baikal-T1 APB-bus driverSerge Semin
Baikal-T1 AXI-APB bridge is used to access the SoC subsystem CSRs. IO requests are routed to this bus by means of the DW AMBA 3 AXI Interconnect. In case if an attempted APB transaction stays with no response for a pre-defined time an interrupt occurs and the bus gets freed for a next operation. This driver provides the interrupt handler to detect the erroneous address, prints an error message about the address fault, updates an errors counter. The counter and the APB-bus operations timeout can be accessed via corresponding sysfs nodes. A dedicated sysfs-node can be also used to artificially cause the bus errors described above. [arnd: fix build warnings for missing includes and wrong return types] Link: https://lore.kernel.org/r/20200526125928.17096-6-Sergey.Semin@baikalelectronics.ru Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Paul Burton <paulburton@kernel.org> Cc: Olof Johansson <olof@lixom.net> Cc: Rob Herring <robh+dt@kernel.org> Cc: linux-mips@vger.kernel.org Cc: soc@kernel.org Cc: devicetree@vger.kernel.org Reported-by: kbuild test robot <lkp@intel.com> Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>