From patchwork Tue Sep 25 09:03:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10613723 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EFBD15E8 for ; Tue, 25 Sep 2018 09:04:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F6082836F for ; Tue, 25 Sep 2018 09:04:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7257329307; Tue, 25 Sep 2018 09:04:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FC252836F for ; Tue, 25 Sep 2018 09:04:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726586AbeIYPLH (ORCPT ); Tue, 25 Sep 2018 11:11:07 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43664 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728799AbeIYPLH (ORCPT ); Tue, 25 Sep 2018 11:11:07 -0400 Received: by mail-wr1-f65.google.com with SMTP id z14-v6so4965360wrs.10 for ; Tue, 25 Sep 2018 02:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=24xEIGND92Wry87aRP5S+r2CoVI/mGeClIEhmLV7kWE=; b=QFkBO4n0OJHz1OCdkarXuxWrZ1/9HdldlP+H6dN4WG6Q84n0T4V3bXkg++3crFFLHc ifJLjRg+Q/WygElxH6nJ13OH/0ilBVh9yE+oUKMQez9cFKKHkcgSsC6GJy1XV/eS0M0F /5XeDdoNK08NyuYvFggL4yvQAh7txa6zDBqzc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=24xEIGND92Wry87aRP5S+r2CoVI/mGeClIEhmLV7kWE=; b=HesfS+WIiDlgQY97u+Nfy3ja5u3lUG7Xjg6QZLyLZQWVncGdpV8PjO+2dcHIFVX/zm jDSTXG8oYKQsC/7r3IruJY057fDFpBP+u0dd3F9oFggXS9N/n+bHU1Tu6YShxYwB5+ZC 6Ka8xul3dA4HsP4A/S2KK2dt5zsPpaZjTA8GPP+6eTT+bBorKfCVoIwYEZBiyc4IIJag Hbfvt3nYTAioAHrYp6iWOuCsE8E2YLs71LKSvatAUkcsH0qRCQqRa/dQpqPJ70MVZdkB h/A4GFeFA3BJwn/4lS1VqfpS1TC+gtX3d9X5JdHH+OAad0gvbvoN1PaxPqC3fnrGLKQn Z9CA== X-Gm-Message-State: ABuFfojEL3cs9Hnfc+rAMKMMrfqwbGrR/+SFnddVW5ETWoO5laCPMVGE OwGIlJ9e02ZFTCWDjLSghmwq+w== X-Google-Smtp-Source: ACcGV63OLoXsZVmu8be4qAjDQjiS6MZC+2pQZRumfLVZKin2P/kkh1npiFECmkYGkF3kpacm3Wjq/g== X-Received: by 2002:adf:a925:: with SMTP id u34-v6mr14366wrc.175.1537866273230; Tue, 25 Sep 2018 02:04:33 -0700 (PDT) Received: from localhost.localdomain (251.150.136.77.rev.sfr.net. [77.136.150.251]) by smtp.gmail.com with ESMTPSA id y206-v6sm1523828wmg.14.2018.09.25.02.04.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Sep 2018 02:04:32 -0700 (PDT) From: Daniel Lezcano To: edubezval@gmail.com Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, daniel.lezcano@linaro.org, leo.yan@linaro.org, Zhang Rui Subject: [PATCH 09/14] thermal/drivers/hisi: Use platform_get_irq_byname Date: Tue, 25 Sep 2018 11:03:07 +0200 Message-Id: <1537866192-12320-10-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537866192-12320-1-git-send-email-daniel.lezcano@linaro.org> References: <1537866192-12320-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As we have the interrupt names defines, replace platform_get_irq() by platform_get_irq_byname(), so no confusion can be made when getting the interrupt with the sensor id. Signed-off-by: Daniel Lezcano --- drivers/thermal/hisi_thermal.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index a542cb3..941c2c4 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -63,6 +63,7 @@ struct hisi_thermal_data; struct hisi_thermal_sensor { struct hisi_thermal_data *data; struct thermal_zone_device *tzd; + const char *irq_name; uint32_t id; uint32_t thres_temp; }; @@ -407,6 +408,7 @@ static int hi6220_thermal_probe(struct hisi_thermal_data *data) return -ENOMEM; data->sensor[0].id = HI6220_CLUSTER0_SENSOR; + data->sensor[0].irq_name = "tsensor_intr"; data->sensor[0].data = data; data->nr_sensors = 1; @@ -423,6 +425,7 @@ static int hi3660_thermal_probe(struct hisi_thermal_data *data) return -ENOMEM; data->sensor[0].id = HI3660_BIG_SENSOR; + data->sensor[0].irq_name = "tsensor_a73"; data->sensor[0].data = data; data->nr_sensors = 1; @@ -576,13 +579,13 @@ static int hisi_thermal_probe(struct platform_device *pdev) return ret; } - data->irq = platform_get_irq(pdev, 0); + data->irq = platform_get_irq_byname(pdev, sensor->irq_name); if (data->irq < 0) return data->irq; ret = devm_request_threaded_irq(dev, data->irq, NULL, hisi_thermal_alarm_irq_thread, - IRQF_ONESHOT, "hisi_thermal", + IRQF_ONESHOT, sensor->irq_name, sensor); if (ret < 0) { dev_err(dev, "failed to request alarm irq: %d\n", ret);