On Mon, Nov 18, 2019 at 08:57:57AM +0200, Matti Vaittinen wrote: > +static int ramp_delay_supported(struct regulator_dev *rdev) > +{ > + switch (rdev->desc->id) { > + case BD71828_BUCK1: > + case BD71828_BUCK2: > + case BD71828_BUCK6: > + case BD71828_BUCK7: > + return 1; > + default: > + break; > + } > + return 0; > +} > + > +static int bd71828_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay) > +{ > + unsigned int val; > + > + if (!ramp_delay_supported(rdev)) { > + dev_err(&rdev->dev, "%s: can't set ramp-delay\n", > + rdev->desc->name); > + return -EINVAL; Rather than doing this it's better to just not provide the operation for devices that don't support it, that makes the handling in the core easier.
Attachment:
signature.asc
Description: PGP signature