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

Commit 84614013 authored by Pavan Kumar Chilamkurthi's avatar Pavan Kumar Chilamkurthi
Browse files

msm: camera: Use devm API to free irq



Use devm_free_irq() API to free IRQ because we
use the devm variant to request IRQ. Do this so
that the request and free variants of IRQ
request/free calls are in alignment with each other

CRs-Fixed: 2034833
Change-Id: Ic1b1980f510271b98277e8314b3f97606c24d741
Signed-off-by: default avatarPavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
parent 16496105
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -412,6 +412,7 @@ int cam_soc_util_request_platform_resource(struct cam_hw_soc_info *soc_info,
			goto put_regulator;
		}
		disable_irq(soc_info->irq_line->start);
		soc_info->irq_data = irq_data;
	}

	/* Get Clock */
@@ -439,7 +440,8 @@ int cam_soc_util_request_platform_resource(struct cam_hw_soc_info *soc_info,

	if (soc_info->irq_line) {
		disable_irq(soc_info->irq_line->start);
		free_irq(soc_info->irq_line->start, soc_info);
		devm_free_irq(&soc_info->pdev->dev,
			soc_info->irq_line->start, irq_data);
	}

put_regulator:
@@ -495,7 +497,8 @@ int cam_soc_util_release_platform_resource(struct cam_hw_soc_info *soc_info)

	if (soc_info->irq_line) {
		disable_irq(soc_info->irq_line->start);
		free_irq(soc_info->irq_line->start, soc_info);
		devm_free_irq(&soc_info->pdev->dev,
			soc_info->irq_line->start, soc_info->irq_data);
	}

	return 0;
+2 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ struct cam_soc_reg_map {
 * @index:                  Instance id for the camera device
 * @irq_name:               Name of the irq associated with the device
 * @irq_line:               Irq resource
 * @irq_data:               Private data that is passed when IRQ is requested
 * @num_mem_block:          Number of entry in the "reg-names"
 * @mem_block_name:         Array of the reg block name
 * @mem_block_cam_base:     Array of offset of this register space compared
@@ -85,6 +86,7 @@ struct cam_hw_soc_info {

	const char                     *irq_name;
	struct resource                *irq_line;
	void                           *irq_data;

	uint32_t                        num_mem_block;
	const char                     *mem_block_name[CAM_SOC_MAX_BLOCK];