Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9bf56858 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

mhi: core: Fix missing return value check



sysfs_create_group() and mhi_read_reg_field() APIs
expect to check the return value. Add return check
to fix compilation error.

Change-Id: I0a8249cd6b87eba51c130add97098de6cafbc908
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 7e01cae5
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -325,10 +325,19 @@ static const struct attribute_group mhi_sysfs_group = {

void 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,
	int ret;

	ret = sysfs_create_group(&mhi_cntrl->mhi_dev->dev.kobj,
			&mhi_sysfs_group);
	if (ret)
		MHI_CNTRL_LOG("Failed to create mhi_sysfs_group");

	if (mhi_cntrl->mhi_tsync) {
		ret = sysfs_create_group(&mhi_cntrl->mhi_dev->dev.kobj,
				   &mhi_tsync_group);
		if (ret)
			MHI_CNTRL_LOG("Failed to create mhi_tsync_group");
	}
}

void mhi_destroy_sysfs(struct mhi_controller *mhi_cntrl)
+4 −2
Original line number Diff line number Diff line
@@ -1717,16 +1717,18 @@ irqreturn_t mhi_intvec_handlr(int irq_number, void *dev)

	struct mhi_controller *mhi_cntrl = dev;
	u32 in_reset = -1;
	int ret = 0;

	/* wake up any events waiting for state change */
	MHI_VERB("Enter\n");
	if (unlikely(mhi_cntrl->initiate_mhi_reset)) {
		mhi_read_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL,
		ret = mhi_read_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL,
			MHICTRL_RESET_MASK, MHICTRL_RESET_SHIFT, &in_reset);

		mhi_cntrl->initiate_mhi_reset = !!in_reset;
	}
	wake_up_all(&mhi_cntrl->state_event);
	MHI_VERB("Exit\n");
	MHI_VERB("Exit: ret %d\n", ret);

	if (MHI_IN_MISSION_MODE(mhi_cntrl->ee))
		queue_work(mhi_cntrl->wq, &mhi_cntrl->special_work);