Commit 0638d56fbb6cf8367fcf01a1febf6a191b0e0704
Committed by
Samuel Ortiz
1 parent
7d76ac15ad
Exists in
master
and in
7 other branches
mfd: mfd_cell is now implicitly available to twl4030 drivers
The cell's platform_data is now accessed with a helper function; change clients to use that, and remove the now-unused data_size. Signed-off-by: Andres Salomon <dilinger@queued.net> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Showing 3 changed files with 6 additions and 5 deletions Side-by-side Diff
drivers/input/misc/twl4030-vibra.c
... | ... | @@ -29,6 +29,7 @@ |
29 | 29 | #include <linux/workqueue.h> |
30 | 30 | #include <linux/i2c/twl.h> |
31 | 31 | #include <linux/mfd/twl4030-codec.h> |
32 | +#include <linux/mfd/core.h> | |
32 | 33 | #include <linux/input.h> |
33 | 34 | #include <linux/slab.h> |
34 | 35 | |
... | ... | @@ -196,7 +197,7 @@ |
196 | 197 | |
197 | 198 | static int __devinit twl4030_vibra_probe(struct platform_device *pdev) |
198 | 199 | { |
199 | - struct twl4030_codec_vibra_data *pdata = pdev->dev.platform_data; | |
200 | + struct twl4030_codec_vibra_data *pdata = mfd_get_data(pdev); | |
200 | 201 | struct vibra_info *info; |
201 | 202 | int ret; |
202 | 203 |
drivers/mfd/twl4030-codec.c
... | ... | @@ -209,14 +209,12 @@ |
209 | 209 | cell = &codec->cells[childs]; |
210 | 210 | cell->name = "twl4030-codec"; |
211 | 211 | cell->platform_data = pdata->audio; |
212 | - cell->data_size = sizeof(*pdata->audio); | |
213 | 212 | childs++; |
214 | 213 | } |
215 | 214 | if (pdata->vibra) { |
216 | 215 | cell = &codec->cells[childs]; |
217 | 216 | cell->name = "twl4030-vibra"; |
218 | 217 | cell->platform_data = pdata->vibra; |
219 | - cell->data_size = sizeof(*pdata->vibra); | |
220 | 218 | childs++; |
221 | 219 | } |
222 | 220 |
sound/soc/codecs/twl4030.c
... | ... | @@ -26,6 +26,7 @@ |
26 | 26 | #include <linux/pm.h> |
27 | 27 | #include <linux/i2c.h> |
28 | 28 | #include <linux/platform_device.h> |
29 | +#include <linux/mfd/core.h> | |
29 | 30 | #include <linux/i2c/twl.h> |
30 | 31 | #include <linux/slab.h> |
31 | 32 | #include <sound/core.h> |
... | ... | @@ -732,7 +733,8 @@ |
732 | 733 | |
733 | 734 | static void headset_ramp(struct snd_soc_codec *codec, int ramp) |
734 | 735 | { |
735 | - struct twl4030_codec_audio_data *pdata = codec->dev->platform_data; | |
736 | + struct twl4030_codec_audio_data *pdata = | |
737 | + mfd_get_data(to_platform_device(codec->dev)); | |
736 | 738 | unsigned char hs_gain, hs_pop; |
737 | 739 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
738 | 740 | /* Base values for ramp delay calculation: 2^19 - 2^26 */ |
... | ... | @@ -2297,7 +2299,7 @@ |
2297 | 2299 | |
2298 | 2300 | static int __devinit twl4030_codec_probe(struct platform_device *pdev) |
2299 | 2301 | { |
2300 | - struct twl4030_codec_audio_data *pdata = pdev->dev.platform_data; | |
2302 | + struct twl4030_codec_audio_data *pdata = mfd_get_data(pdev); | |
2301 | 2303 | |
2302 | 2304 | if (!pdata) { |
2303 | 2305 | dev_err(&pdev->dev, "platform_data is missing\n"); |