hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/usb/phy/phy-am335x-control.c
....@@ -118,9 +118,9 @@
118118 MODULE_DEVICE_TABLE(of, omap_control_usb_id_table);
119119
120120 static struct platform_driver am335x_control_driver;
121
-static int match(struct device *dev, void *data)
121
+static int match(struct device *dev, const void *data)
122122 {
123
- struct device_node *node = (struct device_node *)data;
123
+ const struct device_node *node = (const struct device_node *)data;
124124 return dev->of_node == node &&
125125 dev->driver == &am335x_control_driver.driver;
126126 }
....@@ -149,7 +149,6 @@
149149
150150 static int am335x_control_usb_probe(struct platform_device *pdev)
151151 {
152
- struct resource *res;
153152 struct am335x_control_usb *ctrl_usb;
154153 const struct of_device_id *of_id;
155154 const struct phy_control *phy_ctrl;
....@@ -166,13 +165,11 @@
166165
167166 ctrl_usb->dev = &pdev->dev;
168167
169
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl");
170
- ctrl_usb->phy_reg = devm_ioremap_resource(&pdev->dev, res);
168
+ ctrl_usb->phy_reg = devm_platform_ioremap_resource_byname(pdev, "phy_ctrl");
171169 if (IS_ERR(ctrl_usb->phy_reg))
172170 return PTR_ERR(ctrl_usb->phy_reg);
173171
174
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wakeup");
175
- ctrl_usb->wkup = devm_ioremap_resource(&pdev->dev, res);
172
+ ctrl_usb->wkup = devm_platform_ioremap_resource_byname(pdev, "wakeup");
176173 if (IS_ERR(ctrl_usb->wkup))
177174 return PTR_ERR(ctrl_usb->wkup);
178175