mhi: core: Fix unchecked must_check sysfs_create_group() return value

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: I93f2b678684e6fc87567e1a21158f95e9ff49e61
Signed-off-by: Ruchit <ruchitmarathe@gmail.com>
tirimbino
Sultan Alsawaf 3 years ago committed by Ruchit
parent 625f9b08cc
commit 88cbbb4336
  1. 22
      drivers/bus/mhi/core/mhi_init.c
  2. 2
      drivers/bus/mhi/core/mhi_internal.h
  3. 7
      drivers/bus/mhi/core/mhi_pm.c

@ -330,12 +330,24 @@ static const struct attribute_group mhi_sysfs_group = {
.attrs = mhi_sysfs_attrs,
};
void mhi_create_sysfs(struct mhi_controller *mhi_cntrl)
int mhi_create_sysfs(struct mhi_controller *mhi_cntrl)
{
sysfs_create_group(&mhi_cntrl->mhi_dev->dev.kobj, &mhi_sysfs_group);
if (mhi_cntrl->mhi_tsync)
sysfs_create_group(&mhi_cntrl->mhi_dev->dev.kobj,
&mhi_tsync_group);
int ret;
ret = sysfs_create_group(&mhi_cntrl->mhi_dev->dev.kobj,
&mhi_sysfs_group);
if (ret)
return ret;
if (mhi_cntrl->mhi_tsync) {
ret = sysfs_create_group(&mhi_cntrl->mhi_dev->dev.kobj,
&mhi_tsync_group);
if (ret)
sysfs_remove_group(&mhi_cntrl->mhi_dev->dev.kobj,
&mhi_sysfs_group);
}
return ret;
}
void mhi_destroy_sysfs(struct mhi_controller *mhi_cntrl)

@ -848,7 +848,7 @@ int mhi_get_capability_offset(struct mhi_controller *mhi_cntrl, u32 capability,
u32 *offset);
void *mhi_to_virtual(struct mhi_ring *ring, dma_addr_t addr);
int mhi_init_sfr(struct mhi_controller *mhi_cntrl);
void mhi_create_sysfs(struct mhi_controller *mhi_cntrl);
int mhi_create_sysfs(struct mhi_controller *mhi_cntrl);
void mhi_destroy_sysfs(struct mhi_controller *mhi_cntrl);
int mhi_early_notify_device(struct device *dev, void *data);
void mhi_write_reg_offload(struct mhi_controller *mhi_cntrl,

@ -540,7 +540,11 @@ static int mhi_pm_mission_mode_transition(struct mhi_controller *mhi_cntrl)
mhi_special_events_pending(mhi_cntrl);
/* setup sysfs nodes for userspace votes */
mhi_create_sysfs(mhi_cntrl);
ret = mhi_create_sysfs(mhi_cntrl);
if (ret) {
MHI_ERR("Failed to create sysfs nodes with ret:%d\n", ret);
goto error_sysfs_create;
}
mhi_special_events_pending(mhi_cntrl);
@ -549,6 +553,7 @@ static int mhi_pm_mission_mode_transition(struct mhi_controller *mhi_cntrl)
/* add supported devices */
mhi_create_devices(mhi_cntrl);
error_sysfs_create:
read_lock_bh(&mhi_cntrl->pm_lock);
error_mission_mode:

Loading…
Cancel
Save