From 15bc5db0cc6a2eb4d3621b90b53aa5defe9e9d18 Mon Sep 17 00:00:00 2001 From: Dirk Behme Date: Fri, 10 Nov 2006 01:24:53 +0200 Subject: [PATCH] ARM: OMAP: Fix warnings in plat-omap/dsp Fix various warnings warning: ignoring return value of 'xxx', declared with attribute warn_unused_result Signed-off-by: Dirk Behme Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/dsp/dsp_ctl.c | 14 +++++++---- arch/arm/plat-omap/dsp/dsp_mem.c | 8 ++++--- arch/arm/plat-omap/dsp/ipbuf.c | 4 +++- arch/arm/plat-omap/dsp/mblog.c | 6 ++++- arch/arm/plat-omap/dsp/task.c | 40 ++++++++++++++++++++++---------- 5 files changed, 51 insertions(+), 21 deletions(-) diff --git a/arch/arm/plat-omap/dsp/dsp_ctl.c b/arch/arm/plat-omap/dsp/dsp_ctl.c index f0258a38a83..91be986b935 100644 --- a/arch/arm/plat-omap/dsp/dsp_ctl.c +++ b/arch/arm/plat-omap/dsp/dsp_ctl.c @@ -273,7 +273,9 @@ static int dsp_cfg(void) goto out; /* create runtime sysfs entries */ - device_create_file(omap_dsp->dev, &dev_attr_loadinfo); + ret = device_create_file(omap_dsp->dev, &dev_attr_loadinfo); + if (ret) + printk(KERN_ERR "device_create_file failed: %d\n", ret); out: dsp_mem_disable((void *)dspmem_base); @@ -1038,9 +1040,13 @@ out: void __init dsp_ctl_init(void) { - device_create_file(omap_dsp->dev, &dev_attr_ifver); - device_create_file(omap_dsp->dev, &dev_attr_cpustat); - device_create_file(omap_dsp->dev, &dev_attr_icrmask); + int ret; + + ret = device_create_file(omap_dsp->dev, &dev_attr_ifver); + ret |= device_create_file(omap_dsp->dev, &dev_attr_cpustat); + ret |= device_create_file(omap_dsp->dev, &dev_attr_icrmask); + if (ret) + printk(KERN_ERR "device_create_file failed: %d\n", ret); } void dsp_ctl_exit(void) diff --git a/arch/arm/plat-omap/dsp/dsp_mem.c b/arch/arm/plat-omap/dsp/dsp_mem.c index 0c49281a7cf..ac45fafaa5f 100644 --- a/arch/arm/plat-omap/dsp/dsp_mem.c +++ b/arch/arm/plat-omap/dsp/dsp_mem.c @@ -2504,9 +2504,11 @@ int __init dsp_mem_init(void) /* MMU interrupt is not enabled until DSP runs */ disable_irq(omap_dsp->mmu_irq); - device_create_file(omap_dsp->dev, &dev_attr_mmu); - device_create_file(omap_dsp->dev, &dev_attr_exmap); - device_create_file(omap_dsp->dev, &dev_attr_mempool); + ret = device_create_file(omap_dsp->dev, &dev_attr_mmu); + ret |= device_create_file(omap_dsp->dev, &dev_attr_exmap); + ret |= device_create_file(omap_dsp->dev, &dev_attr_mempool); + if (ret) + printk(KERN_ERR "device_create_file failed: %d\n", ret); return 0; } diff --git a/arch/arm/plat-omap/dsp/ipbuf.c b/arch/arm/plat-omap/dsp/ipbuf.c index 7f9a4900150..26cdf74cf73 100644 --- a/arch/arm/plat-omap/dsp/ipbuf.c +++ b/arch/arm/plat-omap/dsp/ipbuf.c @@ -117,7 +117,9 @@ int ipbuf_config(u16 ln, u16 lsz, void *base) " %d words * %d lines at 0x%p.\n", ipbcfg.lsz, ipbcfg.ln, ipbcfg.base); - device_create_file(omap_dsp->dev, &dev_attr_ipbuf); + ret = device_create_file(omap_dsp->dev, &dev_attr_ipbuf); + if (ret) + printk(KERN_ERR "device_create_file failed: %d\n", ret); return ret; diff --git a/arch/arm/plat-omap/dsp/mblog.c b/arch/arm/plat-omap/dsp/mblog.c index e2fb9c3afbf..219845fa602 100644 --- a/arch/arm/plat-omap/dsp/mblog.c +++ b/arch/arm/plat-omap/dsp/mblog.c @@ -260,7 +260,11 @@ static struct device_attribute dev_attr_mblog = __ATTR_RO(mblog); void __init mblog_init(void) { - device_create_file(omap_dsp->dev, &dev_attr_mblog); + int ret; + + ret = device_create_file(omap_dsp->dev, &dev_attr_mblog); + if (ret) + printk(KERN_ERR "device_create_file failed: %d\n", ret); } void mblog_exit(void) diff --git a/arch/arm/plat-omap/dsp/task.c b/arch/arm/plat-omap/dsp/task.c index 18d0e417535..7fcc06acf69 100644 --- a/arch/arm/plat-omap/dsp/task.c +++ b/arch/arm/plat-omap/dsp/task.c @@ -1789,6 +1789,8 @@ static void dsptask_dev_release(struct device *dev) static int taskdev_init(struct taskdev *dev, char *name, unsigned char minor) { + int ret; + taskdev[minor] = dev; spin_lock_init(&dev->proc_list_lock); @@ -1815,10 +1817,14 @@ static int taskdev_init(struct taskdev *dev, char *name, unsigned char minor) dev->dev.bus = &dsptask_bus; sprintf(dev->dev.bus_id, "dsptask%d", minor); dev->dev.release = dsptask_dev_release; - device_register(&dev->dev); - device_create_file(&dev->dev, &dev_attr_devname); - device_create_file(&dev->dev, &dev_attr_devstate); - device_create_file(&dev->dev, &dev_attr_proc_list); + ret = device_register(&dev->dev); + if (ret) + printk(KERN_ERR "device_register failed: %d\n", ret); + ret = device_create_file(&dev->dev, &dev_attr_devname); + ret |= device_create_file(&dev->dev, &dev_attr_devstate); + ret |= device_create_file(&dev->dev, &dev_attr_proc_list); + if (ret) + printk(KERN_ERR "device_create_file failed: %d\n", ret); class_device_create(dsp_task_class, NULL, MKDEV(OMAP_DSP_TASK_MAJOR, minor), NULL, "dsptask%d", minor); @@ -1847,6 +1853,7 @@ static void taskdev_delete(unsigned char minor) static int taskdev_attach_task(struct taskdev *dev, struct dsptask *task) { u16 ttyp = task->ttyp; + int ret; dev->fops.read = sndtyp_acv(ttyp) ? @@ -1883,16 +1890,18 @@ static int taskdev_attach_task(struct taskdev *dev, struct dsptask *task) if (task->map_length) dev->fops.mmap = dsp_task_mmap; - device_create_file(&dev->dev, &dev_attr_taskname); - device_create_file(&dev->dev, &dev_attr_ttyp); + ret = device_create_file(&dev->dev, &dev_attr_taskname); + ret |= device_create_file(&dev->dev, &dev_attr_ttyp); if (sndtyp_wd(ttyp)) { - device_create_file(&dev->dev, &dev_attr_fifosz); - device_create_file(&dev->dev, &dev_attr_fifocnt); + ret |= device_create_file(&dev->dev, &dev_attr_fifosz); + ret |= device_create_file(&dev->dev, &dev_attr_fifocnt); } else - device_create_file(&dev->dev, &dev_attr_ipblink); - device_create_file(&dev->dev, &dev_attr_wsz); + ret |= device_create_file(&dev->dev, &dev_attr_ipblink); + ret |= device_create_file(&dev->dev, &dev_attr_wsz); if (task->map_length) - device_create_file(&dev->dev, &dev_attr_mmap); + ret |= device_create_file(&dev->dev, &dev_attr_mmap); + if (ret) + printk(KERN_ERR "device_create_file failed: %d\n", ret); dev->task = task; task->dev = dev; @@ -2989,7 +2998,14 @@ int __init dsp_taskmod_init(void) return retval; } - bus_register(&dsptask_bus); + retval = bus_register(&dsptask_bus); + if (retval) { + printk(KERN_ERR + "omapdsp: failed to register DSP task bus: %d\n", + retval); + unregister_chrdev(OMAP_DSP_TASK_MAJOR, "dsptask"); + return -EINVAL; + } retval = driver_register(&dsptask_driver); if (retval) { printk(KERN_ERR -- 2.41.1