Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp908878pxv; Fri, 25 Jun 2021 00:47:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBuhxiw/8NvExlsOBNTyub53l4XGIELRLTyZwCBBReZfOggiiPo+M2Es/8/LqIMUyscog+ X-Received: by 2002:aa7:c845:: with SMTP id g5mr12860065edt.306.1624607263478; Fri, 25 Jun 2021 00:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624607263; cv=none; d=google.com; s=arc-20160816; b=yZFkfXVYhe7WpgGvD55HDdbr7NIjQi8FWVU3CdHSp1ZztQip5XwWhlmLIOH1ZvjSwK v3toDpZmBiCtH1uLkczzLdxjmOcX/n2vBcA1yoQO5ihm0WPy2o8S4ADPZhQGcW5RlHkK yMZq/DKpbG2l1AUd+uBs8OosEmjxljaQAmUdFkrmFW9maGxJ2TRQa/SjIHbKu6xOv46p titNXvq0AMWyjgISVwE3Tj70Zo5Xl74kxR0I9cWVgTMJItSKW1Nl0ohu5n51o/C76Gh2 1ece0iKx+N8cshQFOZLzZ8X7VXT6YJyGiZ5Uk+eTNBcbU6dxvchH4ROJave/bT/Lqovg PnRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OGwu70x42f7vK1z0P2kCWlA2s6AniJktb27FskZJmqw=; b=nYjEKXhR7p/7fxrDKwqzeekw5LXbZKDQQaEVhK5RVxRxYl2cCwoH/P9pa/YX2V+nOD JJ9ljbWLU9vDJb7E+11IUwJ2nB5MEM3D4aV2Hs/8jBtvUjuRiGLv+n+seoJn4N1N9Kk4 FsXIrV0LtwDTjLa0ToG5BoCNbg6DmxgOfUrmEBDTt7bMl/903CrPgRjaC9rR7oa2hpwN VVFdJLHhCU2DDhqpZMpUf7c1DzyR8+LnA23wf26Q3/CtRgmbLV3WhYrTJvk//8OBtwyn +1jOfAIb9WOy3IT/H87nHpvEerUecJrQzU3r7uxhA+ONljiJRavBI6QSqQeSXguREJyx L/hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=new0Vv6P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si5775600ede.590.2021.06.25.00.47.20; Fri, 25 Jun 2021 00:47:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=new0Vv6P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbhFYHsj (ORCPT + 99 others); Fri, 25 Jun 2021 03:48:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:40206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbhFYHsc (ORCPT ); Fri, 25 Jun 2021 03:48:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 50C17613C0; Fri, 25 Jun 2021 07:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624607172; bh=zCr7xakHM20j5t0qB7rt1N3MWJ4ELpuHzWFgieOCIbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=new0Vv6Pz1K5A7hRfSwlIQnMARbTBTypdGwWhgzFO9NZ2e0SMHx+o3gaQw372ONA/ R+capB3W5F1GbbXJ99s5hjKh72OCHKcsAkQlKnny7OOPeWDYZMOfJH6hM0oPIRY3lE ZTyBbOvbzQL10CDaFmzxsue+4pN60BgJdaDpxu5MXdZrhMqNMq8y+4Sf7e/xLEUmoG vM4guCUPyyLVQTLj7vLZ4KEO/qZxNPV1I5h6SgKTqQD8DfL1vKbaj74Qdfp1q7wZNO SrZFsH0qIujo9QaUElE5w+L0RJR+HvigRQx5tVv9qNfU4DjlvoR9CEI8vemanarVKY q9lppC7UAflHQ== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lwgXS-004aeM-Eo; Fri, 25 Jun 2021 09:46:10 +0200 From: Mauro Carvalho Chehab To: Greg Kroah-Hartman Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , "Lee Jones" , linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v8 05/12] staging: hi6421-spmi-pmic: use devm_request_threaded_irq() Date: Fri, 25 Jun 2021 09:45:57 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_request_threaded_irq() in order to simplify the driver. Suggested-by: Lee Jones Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c index 29ac53684ad2..2b55acdaad85 100644 --- a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c +++ b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c @@ -250,9 +250,11 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *pdev) ddata->irqs[i] = virq; } - ret = request_threaded_irq(ddata->irq, hi6421_spmi_irq_handler, NULL, - IRQF_TRIGGER_LOW | IRQF_SHARED | IRQF_NO_SUSPEND, - "pmic", ddata); + ret = devm_request_threaded_irq(dev, + ddata->irq, hi6421_spmi_irq_handler, + NULL, + IRQF_TRIGGER_LOW | IRQF_SHARED | IRQF_NO_SUSPEND, + "pmic", ddata); if (ret < 0) { dev_err(dev, "Failed to start IRQ handling thread: error %d\n", ret); @@ -270,13 +272,6 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *pdev) return ret; } -static void hi6421_spmi_pmic_remove(struct spmi_device *pdev) -{ - struct hi6421_spmi_pmic *ddata = dev_get_drvdata(&pdev->dev); - - free_irq(ddata->irq, ddata); -} - static const struct of_device_id pmic_spmi_id_table[] = { { .compatible = "hisilicon,hi6421-spmi" }, { } @@ -289,7 +284,6 @@ static struct spmi_driver hi6421_spmi_pmic_driver = { .of_match_table = pmic_spmi_id_table, }, .probe = hi6421_spmi_pmic_probe, - .remove = hi6421_spmi_pmic_remove, }; module_spmi_driver(hi6421_spmi_pmic_driver); -- 2.31.1