History log of /linux-master/drivers/hwspinlock/sprd_hwspinlock.c
Revision Date Author Comments
# 9a413589 25-Jan-2022 Gustavo A. R. Silva <gustavoars@kernel.org>

hwspinlock: sprd: Use struct_size() helper in devm_kzalloc()

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worst scenario, could lead to heap overflows.

Also, address the following sparse warnings:
drivers/hwspinlock/sprd_hwspinlock.c:96:36: warning: using sizeof on a flexible structure

Link: https://github.com/KSPP/linux/issues/174
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Baolin Wang <baolin.wang7@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220125225723.GA78256@embeddedor


# 8266b809 12-Nov-2020 Chunyan Zhang <chunyan.zhang@unisoc.com>

hwspinlock: sprd: fixed warning of unused variable 'sprd_hwspinlock_of_match'

The macro function of_match_ptr() is NULL if CONFIG_OF is not set, in this
case Clang compiler would complain the of_device_id variable is unused.

Reviewed-by: Baolin Wang <baolin.wang7@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Fixes: d8c8bbbb1aba ("hwspinlock: sprd: Add hardware spinlock driver")
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Link: https://lore.kernel.org/r/20201112070410.14810-1-zhang.lyra@gmail.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 8308678e 29-Oct-2020 Chunyan Zhang <chunyan.zhang@unisoc.com>

hwspinlock: sprd: use module_platform_driver() instead postcore initcall

The hardware spinlock devices are defined in the DT, there's no need for
init calls order, remove boilerplate code by using module_platform_driver.

Reviewed-by: Baolin Wang <baolin.wang7@gmail.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Link: https://lore.kernel.org/r/20201030034654.15775-3-zhang.lyra@gmail.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 3116a993 01-Jun-2020 Baolin Wang <baolin.wang@linux.alibaba.com>

hwspinlock: sprd: Remove redundant header files

Remove redundant header files.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/1590991552-93643-1-git-send-email-baolin.wang@linux.alibaba.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 4d0c1c57 14-Oct-2019 Baolin Wang <baolin.wang@linaro.org>

hwspinlock: sprd: Remove redundant PM runtime implementation

Since the hwspinlock core has changed the PM runtime to be optional, thus
remove the redundant PM runtime implementation in the Spreadtrum hwlock
driver.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# b674a30b 27-Sep-2019 Baolin Wang <baolin.wang@linaro.org>

hwspinlock: sprd: Use devm_hwspin_lock_register() to register hwlock controller

Use devm_hwspin_lock_register() to register the hwlock controller instead of
unregistering the hwlock controller explicitly when removing the device.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# b4d64193 27-Sep-2019 Baolin Wang <baolin.wang@linaro.org>

hwspinlock: sprd: Use devm_add_action_or_reset() for calls to clk_disable_unprepare()

Use devm_add_action_or_reset() for calls to clk_disable_unprepare(),
which can simplify the error handling.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 3070c416 27-Sep-2019 Baolin Wang <baolin.wang@linaro.org>

hwspinlock: sprd: Check the return value of clk_prepare_enable()

We must check the return value of clk_prepare_enable() to make sure the
hardware spinlock controller can be enabled successfully, otherwise we
should return error.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 74cfa956 27-Sep-2019 Baolin Wang <baolin.wang@linaro.org>

hwspinlock: sprd: Change to use devm_platform_ioremap_resource()

Use the new helper that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together, which can simpify the code.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 0c3e890b 10-May-2018 Suman Anna <s-anna@ti.com>

hwspinlock: sprd: Switch to SPDX license identifier

Use the appropriate SPDX license identifiers in the Spreadtrum hardware
spinlock driver source file and drop the previous boilerplate license text.

Cc: Baolin Wang <baolin.wang@spreadtrum.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# d8c8bbbb 16-May-2017 Baolin Wang <baolin.wang@spreadtrum.com>

hwspinlock: sprd: Add hardware spinlock driver

The Spreadtrum hardware spinlock device can provide hardware assistance
for synchronization between the multiple subsystems.

Signed-off-by: Baolin Wang <baolin.wang@spreadtrum.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>