Skip to content

Commit e3a6fa0

Browse files
committed
Merge tag 'hwlock-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull hwspinlock updates from Bjorn Andersson: "Convert u8500 and omap drivers to void-returning remove. Complete the support for representing the Qualcomm TCSR mutex as a mmio device, and check the return value of devm_regmap_field_alloc() in the same" * tag 'hwlock-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation hwspinlock: u8500: Convert to platform remove callback returning void hwspinlock: omap: Convert to platform remove callback returning void hwspinlock: omap: Emit only one error message for errors in .remove() hwspinlock: add a check of devm_regmap_field_alloc in qcom_hwspinlock_probe
2 parents 2be6bc4 + 23316be commit e3a6fa0

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

drivers/hwspinlock/omap_hwspinlock.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,18 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
145145
return ret;
146146
}
147147

148-
static int omap_hwspinlock_remove(struct platform_device *pdev)
148+
static void omap_hwspinlock_remove(struct platform_device *pdev)
149149
{
150150
struct hwspinlock_device *bank = platform_get_drvdata(pdev);
151151
int ret;
152152

153153
ret = hwspin_lock_unregister(bank);
154154
if (ret) {
155155
dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret);
156-
return ret;
156+
return;
157157
}
158158

159159
pm_runtime_disable(&pdev->dev);
160-
161-
return 0;
162160
}
163161

164162
static const struct of_device_id omap_hwspinlock_of_match[] = {
@@ -171,7 +169,7 @@ MODULE_DEVICE_TABLE(of, omap_hwspinlock_of_match);
171169

172170
static struct platform_driver omap_hwspinlock_driver = {
173171
.probe = omap_hwspinlock_probe,
174-
.remove = omap_hwspinlock_remove,
172+
.remove_new = omap_hwspinlock_remove,
175173
.driver = {
176174
.name = "omap_hwspinlock",
177175
.of_match_table = omap_hwspinlock_of_match,

drivers/hwspinlock/qcom_hwspinlock.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,18 @@ static const struct hwspinlock_ops qcom_hwspinlock_ops = {
6969
.unlock = qcom_hwspinlock_unlock,
7070
};
7171

72+
static const struct regmap_config sfpb_mutex_config = {
73+
.reg_bits = 32,
74+
.reg_stride = 4,
75+
.val_bits = 32,
76+
.max_register = 0x100,
77+
.fast_io = true,
78+
};
79+
7280
static const struct qcom_hwspinlock_of_data of_sfpb_mutex = {
7381
.offset = 0x4,
7482
.stride = 0x4,
83+
.regmap_config = &sfpb_mutex_config,
7584
};
7685

7786
static const struct regmap_config tcsr_msm8226_mutex_config = {
@@ -197,6 +206,8 @@ static int qcom_hwspinlock_probe(struct platform_device *pdev)
197206

198207
bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
199208
regmap, field);
209+
if (IS_ERR(bank->lock[i].priv))
210+
return PTR_ERR(bank->lock[i].priv);
200211
}
201212

202213
return devm_hwspin_lock_register(&pdev->dev, bank, &qcom_hwspinlock_ops,

drivers/hwspinlock/u8500_hsem.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,18 @@ static int u8500_hsem_probe(struct platform_device *pdev)
120120
pdata->base_id, num_locks);
121121
}
122122

123-
static int u8500_hsem_remove(struct platform_device *pdev)
123+
static void u8500_hsem_remove(struct platform_device *pdev)
124124
{
125125
struct hwspinlock_device *bank = platform_get_drvdata(pdev);
126126
void __iomem *io_base = bank->lock[0].priv - HSEM_REGISTER_OFFSET;
127127

128128
/* clear all interrupts */
129129
writel(0xFFFF, io_base + HSEM_ICRALL);
130-
131-
return 0;
132130
}
133131

134132
static struct platform_driver u8500_hsem_driver = {
135133
.probe = u8500_hsem_probe,
136-
.remove = u8500_hsem_remove,
134+
.remove_new = u8500_hsem_remove,
137135
.driver = {
138136
.name = "u8500_hsem",
139137
},

0 commit comments

Comments
 (0)