aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/platform.c7
-rw-r--r--include/linux/platform_device.h7
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index a2e3910196e0..fb5609241482 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -161,7 +161,7 @@ static void platform_device_release(struct device *dev)
161 * Create a platform device object which can have other objects attached 161 * Create a platform device object which can have other objects attached
162 * to it, and which will have attached objects freed when it is released. 162 * to it, and which will have attached objects freed when it is released.
163 */ 163 */
164struct platform_device *platform_device_alloc(const char *name, unsigned int id) 164struct platform_device *platform_device_alloc(const char *name, int id)
165{ 165{
166 struct platform_object *pa; 166 struct platform_object *pa;
167 167
@@ -245,7 +245,8 @@ int platform_device_add(struct platform_device *pdev)
245 pdev->dev.bus = &platform_bus_type; 245 pdev->dev.bus = &platform_bus_type;
246 246
247 if (pdev->id != -1) 247 if (pdev->id != -1)
248 snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s.%u", pdev->name, pdev->id); 248 snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s.%d", pdev->name,
249 pdev->id);
249 else 250 else
250 strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE); 251 strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE);
251 252
@@ -359,7 +360,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister);
359 * the Linux driver model. In particular, when such drivers are built 360 * the Linux driver model. In particular, when such drivers are built
360 * as modules, they can't be "hotplugged". 361 * as modules, they can't be "hotplugged".
361 */ 362 */
362struct platform_device *platform_device_register_simple(char *name, unsigned int id, 363struct platform_device *platform_device_register_simple(char *name, int id,
363 struct resource *res, unsigned int num) 364 struct resource *res, unsigned int num)
364{ 365{
365 struct platform_device *pdev; 366 struct platform_device *pdev;
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 8bbd459eafdc..e80804316cdb 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -15,7 +15,7 @@
15 15
16struct platform_device { 16struct platform_device {
17 const char * name; 17 const char * name;
18 u32 id; 18 int id;
19 struct device dev; 19 struct device dev;
20 u32 num_resources; 20 u32 num_resources;
21 struct resource * resource; 21 struct resource * resource;
@@ -35,9 +35,10 @@ extern struct resource *platform_get_resource_byname(struct platform_device *, u
35extern int platform_get_irq_byname(struct platform_device *, char *); 35extern int platform_get_irq_byname(struct platform_device *, char *);
36extern int platform_add_devices(struct platform_device **, int); 36extern int platform_add_devices(struct platform_device **, int);
37 37
38extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); 38extern struct platform_device *platform_device_register_simple(char *, int id,
39 struct resource *, unsigned int);
39 40
40extern struct platform_device *platform_device_alloc(const char *name, unsigned int id); 41extern struct platform_device *platform_device_alloc(const char *name, int id);
41extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); 42extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
42extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); 43extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size);
43extern int platform_device_add(struct platform_device *pdev); 44extern int platform_device_add(struct platform_device *pdev);