Skip to content

Commit 92fad96

Browse files
ukleinekjenswi-linaro
authored andcommitted
tpm/tpm_ftpm_tee: Make use of tee bus methods
The tee bus got dedicated callbacks for probe and remove. Make use of these. This fixes a runtime warning about the driver needing to be converted to the bus methods. Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
1 parent 9e4c780 commit 92fad96

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

drivers/char/tpm/tpm_ftpm_tee.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int ftpm_tee_match(struct tee_ioctl_version_data *ver, const void *data)
169169
* Return:
170170
* On success, 0. On failure, -errno.
171171
*/
172-
static int ftpm_tee_probe(struct device *dev)
172+
static int ftpm_tee_probe_generic(struct device *dev)
173173
{
174174
int rc;
175175
struct tpm_chip *chip;
@@ -251,11 +251,18 @@ static int ftpm_tee_probe(struct device *dev)
251251
return rc;
252252
}
253253

254+
static int ftpm_tee_probe(struct tee_client_device *tcdev)
255+
{
256+
struct device *dev = &tcdev->dev;
257+
258+
return ftpm_tee_probe_generic(dev);
259+
}
260+
254261
static int ftpm_plat_tee_probe(struct platform_device *pdev)
255262
{
256263
struct device *dev = &pdev->dev;
257264

258-
return ftpm_tee_probe(dev);
265+
return ftpm_tee_probe_generic(dev);
259266
}
260267

261268
/**
@@ -265,7 +272,7 @@ static int ftpm_plat_tee_probe(struct platform_device *pdev)
265272
* Return:
266273
* 0 always.
267274
*/
268-
static int ftpm_tee_remove(struct device *dev)
275+
static void ftpm_tee_remove_generic(struct device *dev)
269276
{
270277
struct ftpm_tee_private *pvt_data = dev_get_drvdata(dev);
271278

@@ -285,15 +292,20 @@ static int ftpm_tee_remove(struct device *dev)
285292
tee_client_close_context(pvt_data->ctx);
286293

287294
/* memory allocated with devm_kzalloc() is freed automatically */
295+
}
288296

289-
return 0;
297+
static void ftpm_tee_remove(struct tee_client_device *tcdev)
298+
{
299+
struct device *dev = &tcdev->dev;
300+
301+
ftpm_tee_remove_generic(dev);
290302
}
291303

292304
static void ftpm_plat_tee_remove(struct platform_device *pdev)
293305
{
294306
struct device *dev = &pdev->dev;
295307

296-
ftpm_tee_remove(dev);
308+
ftpm_tee_remove_generic(dev);
297309
}
298310

299311
/**
@@ -335,11 +347,11 @@ static const struct tee_client_device_id optee_ftpm_id_table[] = {
335347
MODULE_DEVICE_TABLE(tee, optee_ftpm_id_table);
336348

337349
static struct tee_client_driver ftpm_tee_driver = {
350+
.probe = ftpm_tee_probe,
351+
.remove = ftpm_tee_remove,
338352
.id_table = optee_ftpm_id_table,
339353
.driver = {
340354
.name = "optee-ftpm",
341-
.probe = ftpm_tee_probe,
342-
.remove = ftpm_tee_remove,
343355
},
344356
};
345357

0 commit comments

Comments
 (0)