Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19f9e188 authored by Jingoo Han's avatar Jingoo Han Committed by Felipe Balbi
Browse files

usb: phy: use dev_get_platdata()



Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent e01ee9f5
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -834,7 +834,7 @@ int usb_otg_start(struct platform_device *pdev)
	int status;
	int status;
	struct resource *res;
	struct resource *res;
	u32 temp;
	u32 temp;
	struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
	struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);


	p_otg = container_of(otg_trans, struct fsl_otg, phy);
	p_otg = container_of(otg_trans, struct fsl_otg, phy);
	fsm = &p_otg->fsm;
	fsm = &p_otg->fsm;
@@ -1105,7 +1105,7 @@ static int fsl_otg_probe(struct platform_device *pdev)
{
{
	int ret;
	int ret;


	if (!pdev->dev.platform_data)
	if (!dev_get_platdata(&pdev->dev))
		return -ENODEV;
		return -ENODEV;


	/* configure the OTG */
	/* configure the OTG */
@@ -1137,7 +1137,7 @@ static int fsl_otg_probe(struct platform_device *pdev)


static int fsl_otg_remove(struct platform_device *pdev)
static int fsl_otg_remove(struct platform_device *pdev)
{
{
	struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
	struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);


	usb_remove_phy(&fsl_otg_dev->phy);
	usb_remove_phy(&fsl_otg_dev->phy);
	free_irq(fsl_otg_dev->irq, fsl_otg_dev);
	free_irq(fsl_otg_dev->irq, fsl_otg_dev);
+5 −5
Original line number Original line Diff line number Diff line
@@ -101,7 +101,7 @@ static void gpio_vbus_work(struct work_struct *work)
{
{
	struct gpio_vbus_data *gpio_vbus =
	struct gpio_vbus_data *gpio_vbus =
		container_of(work, struct gpio_vbus_data, work.work);
		container_of(work, struct gpio_vbus_data, work.work);
	struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data;
	struct gpio_vbus_mach_info *pdata = dev_get_platdata(gpio_vbus->dev);
	int gpio, status, vbus;
	int gpio, status, vbus;


	if (!gpio_vbus->phy.otg->gadget)
	if (!gpio_vbus->phy.otg->gadget)
@@ -155,7 +155,7 @@ static void gpio_vbus_work(struct work_struct *work)
static irqreturn_t gpio_vbus_irq(int irq, void *data)
static irqreturn_t gpio_vbus_irq(int irq, void *data)
{
{
	struct platform_device *pdev = data;
	struct platform_device *pdev = data;
	struct gpio_vbus_mach_info *pdata = pdev->dev.platform_data;
	struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
	struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
	struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
	struct usb_otg *otg = gpio_vbus->phy.otg;
	struct usb_otg *otg = gpio_vbus->phy.otg;


@@ -182,7 +182,7 @@ static int gpio_vbus_set_peripheral(struct usb_otg *otg,


	gpio_vbus = container_of(otg->phy, struct gpio_vbus_data, phy);
	gpio_vbus = container_of(otg->phy, struct gpio_vbus_data, phy);
	pdev = to_platform_device(gpio_vbus->dev);
	pdev = to_platform_device(gpio_vbus->dev);
	pdata = gpio_vbus->dev->platform_data;
	pdata = dev_get_platdata(gpio_vbus->dev);
	gpio = pdata->gpio_pullup;
	gpio = pdata->gpio_pullup;


	if (!gadget) {
	if (!gadget) {
@@ -243,7 +243,7 @@ static int gpio_vbus_set_suspend(struct usb_phy *phy, int suspend)


static int __init gpio_vbus_probe(struct platform_device *pdev)
static int __init gpio_vbus_probe(struct platform_device *pdev)
{
{
	struct gpio_vbus_mach_info *pdata = pdev->dev.platform_data;
	struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
	struct gpio_vbus_data *gpio_vbus;
	struct gpio_vbus_data *gpio_vbus;
	struct resource *res;
	struct resource *res;
	int err, gpio, irq;
	int err, gpio, irq;
@@ -352,7 +352,7 @@ static int __init gpio_vbus_probe(struct platform_device *pdev)
static int __exit gpio_vbus_remove(struct platform_device *pdev)
static int __exit gpio_vbus_remove(struct platform_device *pdev)
{
{
	struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
	struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
	struct gpio_vbus_mach_info *pdata = pdev->dev.platform_data;
	struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
	int gpio = pdata->gpio_vbus;
	int gpio = pdata->gpio_vbus;


	device_init_wakeup(&pdev->dev, 0);
	device_init_wakeup(&pdev->dev, 0);
+2 −2
Original line number Original line Diff line number Diff line
@@ -1419,7 +1419,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
	struct usb_phy *phy;
	struct usb_phy *phy;


	dev_info(&pdev->dev, "msm_otg probe\n");
	dev_info(&pdev->dev, "msm_otg probe\n");
	if (!pdev->dev.platform_data) {
	if (!dev_get_platdata(&pdev->dev)) {
		dev_err(&pdev->dev, "No platform data given. Bailing out\n");
		dev_err(&pdev->dev, "No platform data given. Bailing out\n");
		return -ENODEV;
		return -ENODEV;
	}
	}
@@ -1436,7 +1436,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
		return -ENOMEM;
		return -ENOMEM;
	}
	}


	motg->pdata = pdev->dev.platform_data;
	motg->pdata = dev_get_platdata(&pdev->dev);
	phy = &motg->phy;
	phy = &motg->phy;
	phy->dev = &pdev->dev;
	phy->dev = &pdev->dev;


+1 −1
Original line number Original line Diff line number Diff line
@@ -271,7 +271,7 @@ static int mv_u3d_phy_probe(struct platform_device *pdev)
	void __iomem	*phy_base;
	void __iomem	*phy_base;
	int	ret;
	int	ret;


	pdata = pdev->dev.platform_data;
	pdata = dev_get_platdata(&pdev->dev);
	if (!pdata) {
	if (!pdata) {
		dev_err(&pdev->dev, "%s: no platform data defined\n", __func__);
		dev_err(&pdev->dev, "%s: no platform data defined\n", __func__);
		return -EINVAL;
		return -EINVAL;
+1 −1
Original line number Original line Diff line number Diff line
@@ -673,7 +673,7 @@ int mv_otg_remove(struct platform_device *pdev)


static int mv_otg_probe(struct platform_device *pdev)
static int mv_otg_probe(struct platform_device *pdev)
{
{
	struct mv_usb_platform_data *pdata = pdev->dev.platform_data;
	struct mv_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
	struct mv_otg *mvotg;
	struct mv_otg *mvotg;
	struct usb_otg *otg;
	struct usb_otg *otg;
	struct resource *r;
	struct resource *r;
Loading