lkml.org 
[lkml]   [2021]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] media: i2c: dw9714: add optional regulator support
On Fri, Nov 26, 2021 at 10:01:07AM +0100, Martin Kepplinger wrote:

> + dw9714_dev->vcc = devm_regulator_get_optional(&client->dev, "vcc");
> + if (IS_ERR(dw9714_dev->vcc)) {
> + dev_dbg(&client->dev, "No vcc regulator found: %ld\n",
> + PTR_ERR(dw9714_dev->vcc));
> + dw9714_dev->vcc = NULL;
> + }

To repeat my original feedback: unless the supply can be physically
absent you should use regulator_get(). The _optional variants are only
for cases where the supply might be physically absent.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-11-26 14:07    [W:0.220 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site