Skip to content

Commit

Permalink
driver core: Const-correct platform getbyname functions
Browse files Browse the repository at this point in the history
This converts resource and IRQ getbyname functions for the platform
bus to use const char *, I ran into compiler moanings when I tried
using a const char * for looking up a certain resource.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Linus Walleij authored and Greg Kroah-Hartman committed Jun 16, 2009
1 parent 309b7d6 commit c0afe7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ EXPORT_SYMBOL_GPL(platform_get_irq);
* @name: resource name
*/
struct resource *platform_get_resource_byname(struct platform_device *dev,
unsigned int type, char *name)
unsigned int type,
const char *name)
{
int i;

Expand All @@ -88,7 +89,7 @@ EXPORT_SYMBOL_GPL(platform_get_resource_byname);
* @dev: platform device
* @name: IRQ name
*/
int platform_get_irq_byname(struct platform_device *dev, char *name)
int platform_get_irq_byname(struct platform_device *dev, const char *name)
{
struct resource *r = platform_get_resource_byname(dev, IORESOURCE_IRQ,
name);
Expand Down
4 changes: 2 additions & 2 deletions include/linux/platform_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ extern struct device platform_bus;

extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int);
extern int platform_get_irq(struct platform_device *, unsigned int);
extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *);
extern int platform_get_irq_byname(struct platform_device *, char *);
extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *);
extern int platform_get_irq_byname(struct platform_device *, const char *);
extern int platform_add_devices(struct platform_device **, int);

extern struct platform_device *platform_device_register_simple(const char *, int id,
Expand Down

0 comments on commit c0afe7b

Please sign in to comment.