lkml.org 
[lkml]   [2022]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 1/5] iio: accel: bma400: conversion to device-managed function
On Sat, Mar 19, 2022 at 8:10 PM Jagath Jog J <jagathjog1996@gmail.com> wrote:
>
> This is a conversion to device-managed by using devm_iio_device_register
> inside probe function, now disabling the regulator and putting bma400 to
> power down via a devm_add_action_or_reset() hook.
>
> The dev_set_drvdata() call, bma400_remove() function and hooks in the I2C
> and SPI driver struct is removed as devm_iio_device_register function is
> used to automatically unregister on driver detach.

...

> +static void bma400_disable(void *data_ptr)
> +{
> + struct bma400_data *data = data_ptr;
> + int ret;

> + ret = bma400_set_power_mode(data, POWER_MODE_SLEEP);
> + if (ret)
> + dev_warn(data->dev, "Failed to put device into sleep mode (%pe)\n",
> + ERR_PTR(ret));

By what reason did you remove mutex around this call?

> + regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators);
> +}



--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-03-21 09:33    [W:0.151 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site