spmi: fix some coding style issues at the spmi core
While preparing to port the HiSilicon 6421v600 SPMI driver, I noticed some coding style issues at the SPMI core. Address them. Link: https://lore.kernel.org/r/fec878502147336cbf2cf86e476e9dd797cd7e6f.1601360391.git.mchehab+huawei@kernel.org Reviewed-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Link: https://lore.kernel.org/r/20201210023344.2838141-3-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b1f0aeecd2
commit
0be0a733c9
|
@ -23,6 +23,7 @@ static DEFINE_IDA(ctrl_ida);
|
||||||
static void spmi_dev_release(struct device *dev)
|
static void spmi_dev_release(struct device *dev)
|
||||||
{
|
{
|
||||||
struct spmi_device *sdev = to_spmi_device(dev);
|
struct spmi_device *sdev = to_spmi_device(dev);
|
||||||
|
|
||||||
kfree(sdev);
|
kfree(sdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ static const struct device_type spmi_dev_type = {
|
||||||
static void spmi_ctrl_release(struct device *dev)
|
static void spmi_ctrl_release(struct device *dev)
|
||||||
{
|
{
|
||||||
struct spmi_controller *ctrl = to_spmi_controller(dev);
|
struct spmi_controller *ctrl = to_spmi_controller(dev);
|
||||||
|
|
||||||
ida_simple_remove(&ctrl_ida, ctrl->nr);
|
ida_simple_remove(&ctrl_ida, ctrl->nr);
|
||||||
kfree(ctrl);
|
kfree(ctrl);
|
||||||
}
|
}
|
||||||
|
@ -487,7 +489,7 @@ static void of_spmi_register_devices(struct spmi_controller *ctrl)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
sdev->dev.of_node = node;
|
sdev->dev.of_node = node;
|
||||||
sdev->usid = (u8) reg[0];
|
sdev->usid = (u8)reg[0];
|
||||||
|
|
||||||
err = spmi_device_add(sdev);
|
err = spmi_device_add(sdev);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -531,6 +533,7 @@ EXPORT_SYMBOL_GPL(spmi_controller_add);
|
||||||
static int spmi_ctrl_remove_device(struct device *dev, void *data)
|
static int spmi_ctrl_remove_device(struct device *dev, void *data)
|
||||||
{
|
{
|
||||||
struct spmi_device *spmidev = to_spmi_device(dev);
|
struct spmi_device *spmidev = to_spmi_device(dev);
|
||||||
|
|
||||||
if (dev->type == &spmi_dev_type)
|
if (dev->type == &spmi_dev_type)
|
||||||
spmi_device_remove(spmidev);
|
spmi_device_remove(spmidev);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue