From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] fbdev/ssd1307fb: fix optional VBAT support
Date: Fri, 07 Apr 2017 15:21:00 +0000 [thread overview]
Message-ID: <2681648.EBUsxr9zfa@amdc3058> (raw)
In-Reply-To: <20170403135344.31091-1-bst@pengutronix.de>
Hi,
On Monday, April 03, 2017 03:53:44 PM Bastian Stender wrote:
> SSD1306 needs VBAT when it is wired in charge pump configuration only.
> Other controllers of the SSD1307 family do not need it at all. This was
> introduced by commit ba14301e0356c99803e07db60e129a2ca9e50ff0.
checkpatch.pl complained about this:
ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit ba14301e0356 ("fbdev/ssd1307fb: add support to enable VBAT")'
#6:
introduced by commit ba14301e0356c99803e07db60e129a2ca9e50ff0.
I fixed this while applying the patch.
> Without VBAT configuration the driver now fails with:
>
> failed to get VBAT regulator: -19
>
> This is caused by misinterpretation of devm_regulator_get_optional
> which "returns a struct regulator corresponding to the regulator
> producer or IS_ERR() condition".
>
> Handle -ENODEV without bailing out and making VBAT support really
> optional.
>
> Signed-off-by: Bastian Stender <bst@pengutronix.de>
[...]
> @@ -578,10 +578,14 @@ static int ssd1307fb_probe(struct i2c_client *client,
>
> par->vbat_reg = devm_regulator_get_optional(&client->dev, "vbat");
> if (IS_ERR(par->vbat_reg)) {
> - dev_err(&client->dev, "failed to get VBAT regulator: %ld\n",
> - PTR_ERR(par->vbat_reg));
> ret = PTR_ERR(par->vbat_reg);
> - goto fb_alloc_error;
> + if (ret = -ENODEV) {
> + par->vbat_reg = NULL;
> + } else {
> + dev_err(&client->dev, "failed to get VBAT regulator: %ld\n",
> + ret);
gcc complained after this change:
drivers/video/fbdev/ssd1307fb.c: In function ‘ssd1307fb_probe’:
drivers/video/fbdev/ssd1307fb.c:586:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int’ [-Wformat]
I fixed this while applying the patch.
[...]
Patch queued for 4.11, thanks!
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
next prev parent reply other threads:[~2017-04-07 15:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-03 13:53 [PATCH] fbdev/ssd1307fb: fix optional VBAT support Bastian Stender
2017-04-07 15:21 ` Bartlomiej Zolnierkiewicz [this message]
2017-04-07 15:29 ` Bastian Stender
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=2681648.EBUsxr9zfa@amdc3058 \
--to=b.zolnierkie@samsung.com \
--cc=linux-fbdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).