aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/omap2430.c
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2013-10-03 11:12:34 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-03 18:47:31 -0400
commit8934d3e4d0e7aed1bd067529c667984d7929d92d (patch)
tree9ab63719d84187023bc296b2123d719a9ae17f9c /drivers/usb/musb/omap2430.c
parent918ee0d21ba451634788d04930f09f2c76492e18 (diff)
usb: musb: omap2430: Don't use omap_get_control_dev()
omap_get_control_dev() is being deprecated as it doesn't support multiple instances. As control device is present only from OMAP4 onwards which supports DT only, we use phandles to get the reference to the control device. Also get rid of "ti,has-mailbox" property as it is redundant and we can determine that from whether "ctrl-module" property is present or not. Get rid of has_mailbox from musb_hdrc_platform_data as well. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb/omap2430.c')
-rw-r--r--drivers/usb/musb/omap2430.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index d0fc4d9c7b80..9eab645fed8b 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -38,6 +38,7 @@
38#include <linux/delay.h> 38#include <linux/delay.h>
39#include <linux/usb/musb-omap.h> 39#include <linux/usb/musb-omap.h>
40#include <linux/usb/omap_control_usb.h> 40#include <linux/usb/omap_control_usb.h>
41#include <linux/of_platform.h>
41 42
42#include "musb_core.h" 43#include "musb_core.h"
43#include "omap2430.h" 44#include "omap2430.h"
@@ -524,8 +525,12 @@ static int omap2430_probe(struct platform_device *pdev)
524 glue->dev = &pdev->dev; 525 glue->dev = &pdev->dev;
525 glue->musb = musb; 526 glue->musb = musb;
526 glue->status = OMAP_MUSB_UNKNOWN; 527 glue->status = OMAP_MUSB_UNKNOWN;
528 glue->control_otghs = ERR_PTR(-ENODEV);
527 529
528 if (np) { 530 if (np) {
531 struct device_node *control_node;
532 struct platform_device *control_pdev;
533
529 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 534 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
530 if (!pdata) { 535 if (!pdata) {
531 dev_err(&pdev->dev, 536 dev_err(&pdev->dev,
@@ -554,22 +559,20 @@ static int omap2430_probe(struct platform_device *pdev)
554 of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits); 559 of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits);
555 of_property_read_u32(np, "power", (u32 *)&pdata->power); 560 of_property_read_u32(np, "power", (u32 *)&pdata->power);
556 config->multipoint = of_property_read_bool(np, "multipoint"); 561 config->multipoint = of_property_read_bool(np, "multipoint");
557 pdata->has_mailbox = of_property_read_bool(np,
558 "ti,has-mailbox");
559 562
560 pdata->board_data = data; 563 pdata->board_data = data;
561 pdata->config = config; 564 pdata->config = config;
562 }
563 565
564 if (pdata->has_mailbox) { 566 control_node = of_parse_phandle(np, "ctrl-module", 0);
565 glue->control_otghs = omap_get_control_dev(); 567 if (control_node) {
566 if (IS_ERR(glue->control_otghs)) { 568 control_pdev = of_find_device_by_node(control_node);
567 dev_vdbg(&pdev->dev, "Failed to get control device\n"); 569 if (!control_pdev) {
568 ret = PTR_ERR(glue->control_otghs); 570 dev_err(&pdev->dev, "Failed to get control device\n");
569 goto err2; 571 ret = -EINVAL;
572 goto err2;
573 }
574 glue->control_otghs = &control_pdev->dev;
570 } 575 }
571 } else {
572 glue->control_otghs = ERR_PTR(-ENODEV);
573 } 576 }
574 pdata->platform_ops = &omap2430_ops; 577 pdata->platform_ops = &omap2430_ops;
575 578