Commit d3bad602 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: pcf2123: stop using dev.platform_data

platform_data is for platform specific data, use driver_data instead.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20190819182656.29744-4-alexandre.belloni@bootlin.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 577f6482
...@@ -119,7 +119,7 @@ static const struct regmap_config pcf2123_regmap_config = { ...@@ -119,7 +119,7 @@ static const struct regmap_config pcf2123_regmap_config = {
static int pcf2123_read_offset(struct device *dev, long *offset) static int pcf2123_read_offset(struct device *dev, long *offset)
{ {
struct pcf2123_plat_data *pdata = dev_get_platdata(dev); struct pcf2123_plat_data *pdata = dev_get_drvdata(dev);
int ret, val; int ret, val;
unsigned int reg; unsigned int reg;
...@@ -149,7 +149,7 @@ static int pcf2123_read_offset(struct device *dev, long *offset) ...@@ -149,7 +149,7 @@ static int pcf2123_read_offset(struct device *dev, long *offset)
*/ */
static int pcf2123_set_offset(struct device *dev, long offset) static int pcf2123_set_offset(struct device *dev, long offset)
{ {
struct pcf2123_plat_data *pdata = dev_get_platdata(dev); struct pcf2123_plat_data *pdata = dev_get_drvdata(dev);
s8 reg; s8 reg;
if (offset > OFFSET_STEP * 127) if (offset > OFFSET_STEP * 127)
...@@ -174,7 +174,7 @@ static int pcf2123_set_offset(struct device *dev, long offset) ...@@ -174,7 +174,7 @@ static int pcf2123_set_offset(struct device *dev, long offset)
static int pcf2123_rtc_read_time(struct device *dev, struct rtc_time *tm) static int pcf2123_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ {
struct pcf2123_plat_data *pdata = dev_get_platdata(dev); struct pcf2123_plat_data *pdata = dev_get_drvdata(dev);
u8 rxbuf[7]; u8 rxbuf[7];
int ret; int ret;
...@@ -205,7 +205,7 @@ static int pcf2123_rtc_read_time(struct device *dev, struct rtc_time *tm) ...@@ -205,7 +205,7 @@ static int pcf2123_rtc_read_time(struct device *dev, struct rtc_time *tm)
static int pcf2123_rtc_set_time(struct device *dev, struct rtc_time *tm) static int pcf2123_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ {
struct pcf2123_plat_data *pdata = dev_get_platdata(dev); struct pcf2123_plat_data *pdata = dev_get_drvdata(dev);
u8 txbuf[7]; u8 txbuf[7];
int ret; int ret;
...@@ -248,7 +248,7 @@ static int pcf2123_rtc_alarm_irq_enable(struct device *dev, unsigned int en) ...@@ -248,7 +248,7 @@ static int pcf2123_rtc_alarm_irq_enable(struct device *dev, unsigned int en)
static int pcf2123_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) static int pcf2123_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
{ {
struct pcf2123_plat_data *pdata = dev_get_platdata(dev); struct pcf2123_plat_data *pdata = dev_get_drvdata(dev);
u8 rxbuf[4]; u8 rxbuf[4];
int ret; int ret;
unsigned int val = 0; unsigned int val = 0;
...@@ -276,7 +276,7 @@ static int pcf2123_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) ...@@ -276,7 +276,7 @@ static int pcf2123_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
static int pcf2123_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) static int pcf2123_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
{ {
struct pcf2123_plat_data *pdata = dev_get_platdata(dev); struct pcf2123_plat_data *pdata = dev_get_drvdata(dev);
u8 txbuf[4]; u8 txbuf[4];
int ret; int ret;
...@@ -308,7 +308,7 @@ static int pcf2123_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) ...@@ -308,7 +308,7 @@ static int pcf2123_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
static irqreturn_t pcf2123_rtc_irq(int irq, void *dev) static irqreturn_t pcf2123_rtc_irq(int irq, void *dev)
{ {
struct pcf2123_plat_data *pdata = dev_get_platdata(dev); struct pcf2123_plat_data *pdata = dev_get_drvdata(dev);
struct mutex *lock = &pdata->rtc->ops_lock; struct mutex *lock = &pdata->rtc->ops_lock;
unsigned int val = 0; unsigned int val = 0;
int ret = IRQ_NONE; int ret = IRQ_NONE;
...@@ -333,7 +333,7 @@ static irqreturn_t pcf2123_rtc_irq(int irq, void *dev) ...@@ -333,7 +333,7 @@ static irqreturn_t pcf2123_rtc_irq(int irq, void *dev)
static int pcf2123_reset(struct device *dev) static int pcf2123_reset(struct device *dev)
{ {
struct pcf2123_plat_data *pdata = dev_get_platdata(dev); struct pcf2123_plat_data *pdata = dev_get_drvdata(dev);
int ret; int ret;
unsigned int val = 0; unsigned int val = 0;
...@@ -386,7 +386,8 @@ static int pcf2123_probe(struct spi_device *spi) ...@@ -386,7 +386,8 @@ static int pcf2123_probe(struct spi_device *spi)
GFP_KERNEL); GFP_KERNEL);
if (!pdata) if (!pdata)
return -ENOMEM; return -ENOMEM;
spi->dev.platform_data = pdata;
dev_set_drvdata(&spi->dev, pdata);
pdata->map = devm_regmap_init_spi(spi, &pcf2123_regmap_config); pdata->map = devm_regmap_init_spi(spi, &pcf2123_regmap_config);
...@@ -419,6 +420,7 @@ static int pcf2123_probe(struct spi_device *spi) ...@@ -419,6 +420,7 @@ static int pcf2123_probe(struct spi_device *spi)
pdata->rtc = rtc; pdata->rtc = rtc;
/* Register alarm irq */ /* Register alarm irq */
if (spi->irq > 0) { if (spi->irq > 0) {
ret = devm_request_threaded_irq(&spi->dev, spi->irq, NULL, ret = devm_request_threaded_irq(&spi->dev, spi->irq, NULL,
...@@ -440,7 +442,6 @@ static int pcf2123_probe(struct spi_device *spi) ...@@ -440,7 +442,6 @@ static int pcf2123_probe(struct spi_device *spi)
return 0; return 0;
kfree_exit: kfree_exit:
spi->dev.platform_data = NULL;
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment