From: Andres Salomon <dilinger@queued.net>
To: Marek Belisko <marek.belisko@open-nandra.com>
Cc: gregkh@suse.de, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, cjb@laptop.org,
jon.nettleton@gmail.com
Subject: Re: [PATCH] staging: oplc_dcon: Fix compilation warning.
Date: Fri, 4 Feb 2011 15:10:18 -0800 [thread overview]
Message-ID: <20110204151018.667abf02@debxo> (raw)
In-Reply-To: <1296739328-11960-1-git-send-email-marek.belisko@open-nandra.com>
Thanks, looks good to me. It should probably go in for 2.6.38.
Acked-by: Andres Salomon <dilinger@queued.net>
On Thu, 3 Feb 2011
14:22:08 +0100 Marek Belisko <marek.belisko@open-nandra.com> wrote:
> Fix compilation warning:
> drivers/staging/olpc_dcon/olpc_dcon.c: In function ‘dcon_probe’:
> drivers/staging/olpc_dcon/olpc_dcon.c:704:21: warning: ignoring
> return value of ‘device_create_file’, declared with attribute
> warn_unused_result
>
> and add cleaning of created files when creation of one failed.
>
> Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
> ---
> drivers/staging/olpc_dcon/olpc_dcon.c | 15 ++++++++++++---
> 1 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c
> b/drivers/staging/olpc_dcon/olpc_dcon.c index 56a283d..7221bb8 100644
> --- a/drivers/staging/olpc_dcon/olpc_dcon.c
> +++ b/drivers/staging/olpc_dcon/olpc_dcon.c
> @@ -674,7 +674,7 @@ static int dcon_detect(struct i2c_client *client,
> struct i2c_board_info *info)
> static int dcon_probe(struct i2c_client *client, const struct
> i2c_device_id *id) {
> - int rc, i;
> + int rc, i, j;
>
> if (num_registered_fb >= 1)
> fbinfo = registered_fb[0];
> @@ -700,8 +700,14 @@ static int dcon_probe(struct i2c_client *client,
> const struct i2c_device_id *id) goto edev;
> }
>
> - for(i = 0; i < ARRAY_SIZE(dcon_device_files); i++)
> - device_create_file(&dcon_device->dev,
> &dcon_device_files[i]);
> + for(i = 0; i < ARRAY_SIZE(dcon_device_files); i++) {
> + rc = device_create_file(&dcon_device->dev,
> + &dcon_device_files[i]);
> + if (rc) {
> + dev_err(&dcon_device->dev, "Cannot create
> sysfs file\n");
> + goto ecreate;
> + }
> + }
>
> /* Add the backlight device for the DCON */
>
> @@ -728,6 +734,9 @@ static int dcon_probe(struct i2c_client *client,
> const struct i2c_device_id *id)
> return 0;
>
> + ecreate:
> + for (j = 0; j < i; j++)
> + device_remove_file(&dcon_device->dev,
> &dcon_device_files[j]); edev:
> platform_device_unregister(dcon_device);
> dcon_device = NULL;
prev parent reply other threads:[~2011-02-04 23:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-03 13:22 Marek Belisko
2011-02-04 23:10 ` Andres Salomon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110204151018.667abf02@debxo \
--to=dilinger@queued.net \
--cc=cjb@laptop.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=jon.nettleton@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.belisko@open-nandra.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome