pci.c (fb50aacdcf124d98ed93d4cc87867aa60011b52d) pci.c (ecd29dabb2ba2e4a29339bf55129fd1058107206)
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * pci.c - DesignWare HS OTG Controller PCI driver
4 *
5 * Copyright (C) 2004-2013 Synopsys, Inc.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 100 unchanged lines hidden (view full) ---

109 dev_err(dev, "error registering generic PHY (%ld)\n",
110 PTR_ERR(phy));
111 return PTR_ERR(phy);
112 }
113
114 dwc2 = platform_device_alloc("dwc2", PLATFORM_DEVID_AUTO);
115 if (!dwc2) {
116 dev_err(dev, "couldn't allocate dwc2 device\n");
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * pci.c - DesignWare HS OTG Controller PCI driver
4 *
5 * Copyright (C) 2004-2013 Synopsys, Inc.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 100 unchanged lines hidden (view full) ---

109 dev_err(dev, "error registering generic PHY (%ld)\n",
110 PTR_ERR(phy));
111 return PTR_ERR(phy);
112 }
113
114 dwc2 = platform_device_alloc("dwc2", PLATFORM_DEVID_AUTO);
115 if (!dwc2) {
116 dev_err(dev, "couldn't allocate dwc2 device\n");
117 return -ENOMEM;
117 goto err;
118 }
119
120 memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res));
121
122 res[0].start = pci_resource_start(pci, 0);
123 res[0].end = pci_resource_end(pci, 0);
124 res[0].name = "dwc2";
125 res[0].flags = IORESOURCE_MEM;
126
127 res[1].start = pci->irq;
128 res[1].name = "dwc2";
129 res[1].flags = IORESOURCE_IRQ;
130
131 ret = platform_device_add_resources(dwc2, res, ARRAY_SIZE(res));
132 if (ret) {
133 dev_err(dev, "couldn't add resources to dwc2 device\n");
118 }
119
120 memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res));
121
122 res[0].start = pci_resource_start(pci, 0);
123 res[0].end = pci_resource_end(pci, 0);
124 res[0].name = "dwc2";
125 res[0].flags = IORESOURCE_MEM;
126
127 res[1].start = pci->irq;
128 res[1].name = "dwc2";
129 res[1].flags = IORESOURCE_IRQ;
130
131 ret = platform_device_add_resources(dwc2, res, ARRAY_SIZE(res));
132 if (ret) {
133 dev_err(dev, "couldn't add resources to dwc2 device\n");
134 return ret;
134 goto err;
135 }
136
137 dwc2->dev.parent = dev;
138
139 ret = dwc2_pci_quirks(pci, dwc2);
140 if (ret)
141 goto err;
142
143 glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL);
144 if (!glue)
135 }
136
137 dwc2->dev.parent = dev;
138
139 ret = dwc2_pci_quirks(pci, dwc2);
140 if (ret)
141 goto err;
142
143 glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL);
144 if (!glue)
145 return -ENOMEM;
145 goto err;
146
147 ret = platform_device_add(dwc2);
148 if (ret) {
149 dev_err(dev, "failed to register dwc2 device\n");
150 goto err;
151 }
152
153 glue->phy = phy;

--- 34 unchanged lines hidden ---
146
147 ret = platform_device_add(dwc2);
148 if (ret) {
149 dev_err(dev, "failed to register dwc2 device\n");
150 goto err;
151 }
152
153 glue->phy = phy;

--- 34 unchanged lines hidden ---