Skip to content

Commit 0459302

Browse files
dtorjarkkojs
authored andcommitted
tpm: st33zp24: drop support for platform data
Drop support for platform data from the driver because there are no users of st33zp24_platform_data structure in the mainline kernel. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
1 parent 479174d commit 0459302

File tree

4 files changed

+10
-94
lines changed

4 files changed

+10
-94
lines changed

drivers/char/tpm/st33zp24/i2c.c

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/of_gpio.h>
1313
#include <linux/acpi.h>
1414
#include <linux/tpm.h>
15-
#include <linux/platform_data/st33zp24.h>
1615

1716
#include "../tpm.h"
1817
#include "st33zp24.h"
@@ -178,36 +177,6 @@ static int st33zp24_i2c_of_request_resources(struct i2c_client *client)
178177
return 0;
179178
}
180179

181-
static int st33zp24_i2c_request_resources(struct i2c_client *client)
182-
{
183-
struct tpm_chip *chip = i2c_get_clientdata(client);
184-
struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev);
185-
struct st33zp24_i2c_phy *phy = tpm_dev->phy_id;
186-
struct st33zp24_platform_data *pdata;
187-
int ret;
188-
189-
pdata = client->dev.platform_data;
190-
if (!pdata) {
191-
dev_err(&client->dev, "No platform data\n");
192-
return -ENODEV;
193-
}
194-
195-
/* store for late use */
196-
phy->io_lpcpd = pdata->io_lpcpd;
197-
198-
if (gpio_is_valid(pdata->io_lpcpd)) {
199-
ret = devm_gpio_request_one(&client->dev,
200-
pdata->io_lpcpd, GPIOF_OUT_INIT_HIGH,
201-
"TPM IO_LPCPD");
202-
if (ret) {
203-
dev_err(&client->dev, "Failed to request lpcpd pin\n");
204-
return ret;
205-
}
206-
}
207-
208-
return 0;
209-
}
210-
211180
/*
212181
* st33zp24_i2c_probe initialize the TPM device
213182
* @param: client, the i2c_client description (TPM I2C description).
@@ -219,7 +188,6 @@ static int st33zp24_i2c_probe(struct i2c_client *client,
219188
const struct i2c_device_id *id)
220189
{
221190
int ret;
222-
struct st33zp24_platform_data *pdata;
223191
struct st33zp24_i2c_phy *phy;
224192

225193
if (!client) {
@@ -240,19 +208,16 @@ static int st33zp24_i2c_probe(struct i2c_client *client,
240208

241209
phy->client = client;
242210

243-
pdata = client->dev.platform_data;
244-
if (!pdata && client->dev.of_node) {
211+
if (client->dev.of_node) {
245212
ret = st33zp24_i2c_of_request_resources(client);
246213
if (ret)
247214
return ret;
248-
} else if (pdata) {
249-
ret = st33zp24_i2c_request_resources(client);
250-
if (ret)
251-
return ret;
252215
} else if (ACPI_HANDLE(&client->dev)) {
253216
ret = st33zp24_i2c_acpi_request_resources(client);
254217
if (ret)
255218
return ret;
219+
} else {
220+
return -ENODEV;
256221
}
257222

258223
return st33zp24_probe(phy, &i2c_phy_ops, &client->dev, client->irq,

drivers/char/tpm/st33zp24/spi.c

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/of_gpio.h>
1313
#include <linux/acpi.h>
1414
#include <linux/tpm.h>
15-
#include <linux/platform_data/st33zp24.h>
1615

1716
#include "../tpm.h"
1817
#include "st33zp24.h"
@@ -296,37 +295,6 @@ static int st33zp24_spi_of_request_resources(struct spi_device *spi_dev)
296295
return 0;
297296
}
298297

299-
static int st33zp24_spi_request_resources(struct spi_device *dev)
300-
{
301-
struct tpm_chip *chip = spi_get_drvdata(dev);
302-
struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev);
303-
struct st33zp24_spi_phy *phy = tpm_dev->phy_id;
304-
struct st33zp24_platform_data *pdata;
305-
int ret;
306-
307-
pdata = dev->dev.platform_data;
308-
if (!pdata) {
309-
dev_err(&dev->dev, "No platform data\n");
310-
return -ENODEV;
311-
}
312-
313-
/* store for late use */
314-
phy->io_lpcpd = pdata->io_lpcpd;
315-
316-
if (gpio_is_valid(pdata->io_lpcpd)) {
317-
ret = devm_gpio_request_one(&dev->dev,
318-
pdata->io_lpcpd, GPIOF_OUT_INIT_HIGH,
319-
"TPM IO_LPCPD");
320-
if (ret) {
321-
dev_err(&dev->dev, "%s : reset gpio_request failed\n",
322-
__FILE__);
323-
return ret;
324-
}
325-
}
326-
327-
return 0;
328-
}
329-
330298
/*
331299
* st33zp24_spi_probe initialize the TPM device
332300
* @param: dev, the spi_device description (TPM SPI description).
@@ -336,7 +304,6 @@ static int st33zp24_spi_request_resources(struct spi_device *dev)
336304
static int st33zp24_spi_probe(struct spi_device *dev)
337305
{
338306
int ret;
339-
struct st33zp24_platform_data *pdata;
340307
struct st33zp24_spi_phy *phy;
341308

342309
/* Check SPI platform functionnalities */
@@ -353,19 +320,16 @@ static int st33zp24_spi_probe(struct spi_device *dev)
353320

354321
phy->spi_device = dev;
355322

356-
pdata = dev->dev.platform_data;
357-
if (!pdata && dev->dev.of_node) {
323+
if (dev->dev.of_node) {
358324
ret = st33zp24_spi_of_request_resources(dev);
359325
if (ret)
360326
return ret;
361-
} else if (pdata) {
362-
ret = st33zp24_spi_request_resources(dev);
363-
if (ret)
364-
return ret;
365327
} else if (ACPI_HANDLE(&dev->dev)) {
366328
ret = st33zp24_spi_acpi_request_resources(dev);
367329
if (ret)
368330
return ret;
331+
} else {
332+
return -ENODEV;
369333
}
370334

371335
phy->latency = st33zp24_spi_evaluate_latency(phy);
@@ -411,7 +375,7 @@ static SIMPLE_DEV_PM_OPS(st33zp24_spi_ops, st33zp24_pm_suspend,
411375

412376
static struct spi_driver st33zp24_spi_driver = {
413377
.driver = {
414-
.name = TPM_ST33_SPI,
378+
.name = "st33zp24-spi",
415379
.pm = &st33zp24_spi_ops,
416380
.of_match_table = of_match_ptr(of_st33zp24_spi_match),
417381
.acpi_match_table = ACPI_PTR(st33zp24_spi_acpi_match),

drivers/char/tpm/st33zp24/st33zp24.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#ifndef __LOCAL_ST33ZP24_H__
88
#define __LOCAL_ST33ZP24_H__
99

10+
#define TPM_ST33_I2C "st33zp24-i2c"
11+
#define TPM_ST33_SPI "st33zp24-spi"
12+
1013
#define TPM_WRITE_DIRECTION 0x80
1114
#define ST33ZP24_BUFSIZE 2048
1215

include/linux/platform_data/st33zp24.h

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)