From patchwork Mon Sep 20 07:17:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12504699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6711CC433EF for ; Mon, 20 Sep 2021 07:20:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31A9F610A3 for ; Mon, 20 Sep 2021 07:20:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 31A9F610A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4oa9d1OA/mzoPuZccgVmPfA4WaxrmbN3UmCUM+mcX58=; b=Gc7XTnAt+F63SB E+8Cj/otlDZ//VF1MTUsxAL3nIptYBYqrtHZ4+7pG6YgGO9aVef90QyAAp5oM14CdX4QfenBid9kU 2R7KbfPHPbxJ/ZL8Rr1Uy5URnmGtJJv1Zct6275YdreIGyUXVghIc6phATg2ykMnilS5uszTfh625 BjL+Md/WdJQ0x3/OLVwjKS+ERhJ+mi7GCycE8tKVLz2jKHVIkTLHHpsVVOQarwXA7bRiUxC3hdRht dk1SjLzYKHlh+sI5SwXSUpPZo17CUGAAB90ruPwXMvAeECjSu5TYToaOwGIsZrOSa2f8b2aj4RI9H bnB5T9QdnB/e2h4KGgFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSDZC-000lEw-3I; Mon, 20 Sep 2021 07:18:18 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSDZ2-000lCU-5M for linux-arm-kernel@lists.infradead.org; Mon, 20 Sep 2021 07:18:10 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id DF7BF3F4BC for ; Mon, 20 Sep 2021 07:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632122286; bh=g/5RG3r3yZseQXLqjOW/OPcxsvmzNDs0bMtIh+wjazo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Rk5yJtnYQOjh8Bt7XBs/pZczD7mKoK+3dihEQTAMaDAQMbAuwV61WtNZICKdZWyo0 OfaCNYd9TSf7pDy4jfQVA8uofZ4oEtGK8vBr/ZjmHJbg5lUYMpyToDvDap/w/bC0Wl aDwDqqVRURupVmDPslOU0VYsEa17B/K1ogoUYV+slWO4LuMeJFo/NoVkfhgfQ7iF1p Cu9MWF8E+zngFUETaDa+PIHKYn6wY019TAO1HN8BdYqVZ1rayuK+WjDdJqZCoxYYvM 2ieOtccGOnQ4i0Vvq9DNDaw43hOiGgWEARhZM4tVRlpduktsnuSaPCKIJRIJLcZQrW N8oOCqNLTe1JA== Received: by mail-wm1-f70.google.com with SMTP id j16-20020a1c2310000000b0030b3dce20e1so3187480wmj.0 for ; Mon, 20 Sep 2021 00:18:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g/5RG3r3yZseQXLqjOW/OPcxsvmzNDs0bMtIh+wjazo=; b=GuJVIenCjmjsyvPU6a4MUSOu/AHL59FbQul3Ro59Fx2C9jMPg4uHIsmZiZH0wOe0Bi g3gr+gttj/09sl+HSODXcFOIF0FijAvbaz6lzLFq22oP0aCq4fkNDAKOxwNgZ8bTmp3S tFllB8HoEUIAAYDggPTxZ/ZjvqPrE2DghsMD0jR6X7bT6LS3zCWeiKcXhvRtxs/64UM/ tTLwvmn/Qo55l1EHagoxLclkUrlWsXZ/Jg60pNUTzdclOq+AHxsMma79w3gWFtWsMoYr GlbkxhLmtUbgW2VV73xJOd9voYwPnUhzcr48zNrQHsT7roDyPK531rXG7LoiXKzx7aQy dfag== X-Gm-Message-State: AOAM530zjEycvZhn/Nu0Rch1Mdw36twztcVCLcZdZ1BhyEOiq1lfmZ5i GjlT6aLEm985/+3VSpUVoIJBkwVRQWwb1l5nu1dNw4nLqH55xDWlDExawcugVJSZUU7msK4lP2q OoKU9gO6X9zpKTEStTxTEaFNTzUuE16sUh/Qp/UuGj7KGpuYZp+D2 X-Received: by 2002:adf:b7c5:: with SMTP id t5mr26612614wre.322.1632122286577; Mon, 20 Sep 2021 00:18:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz09HTrwbItt4V4htloX64whzplHYzcpSmGaXTvrQepaoBp1J3Tpven9yjUCHjyNrL5/xX1aw== X-Received: by 2002:adf:b7c5:: with SMTP id t5mr26612589wre.322.1632122286380; Mon, 20 Sep 2021 00:18:06 -0700 (PDT) Received: from kozik-lap.lan (lk.84.20.244.219.dc.cable.static.lj-kabel.net. [84.20.244.219]) by smtp.gmail.com with ESMTPSA id a202sm6990798wmd.15.2021.09.20.00.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 00:18:05 -0700 (PDT) From: Krzysztof Kozlowski To: Rob Herring , Krzysztof Kozlowski , Chanwoo Choi , MyungJoo Ham , Kyungmin Park , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 2/3] devfreq: exynos-ppmu: simplify parsing event-type from DT Date: Mon, 20 Sep 2021 09:17:52 +0200 Message-Id: <20210920071753.38560-2-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210920071540.38337-1-krzysztof.kozlowski@canonical.com> References: <20210920071540.38337-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210920_001808_383626_6FE1AF52 X-CRM114-Status: GOOD ( 18.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When parsing devicetree, the function of_get_devfreq_events(), for each device child node, iterates over array of possible events "ppmu_events" till it finds one matching by node name. When match is found the ppmu_events[i] points to element having both the name of the event and the counters ID. Each PPMU device child node might have an "event-name" property with the name of the event, however due to the design of devfreq it must be the same as the device node name. If it is not the same, the devfreq client won't be able to use it via devfreq_event_get_edev_by_phandle(). Since PPMU device child node name must be equal to the "event-name" property (event-name == ppmu_events[i].name), there is no need to find the counters ID by the "event-name". Instead use ppmu_events[i].id which must be equal to it. Signed-off-by: Krzysztof Kozlowski --- drivers/devfreq/event/exynos-ppmu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c index 541bd13ab61d..9b849d781116 100644 --- a/drivers/devfreq/event/exynos-ppmu.c +++ b/drivers/devfreq/event/exynos-ppmu.c @@ -566,13 +566,10 @@ static int of_get_devfreq_events(struct device_node *np, * use default if not. */ if (info->ppmu_type == EXYNOS_TYPE_PPMU_V2) { - int id; /* Not all registers take the same value for * read+write data count. */ - id = __exynos_ppmu_find_ppmu_id(desc[j].name); - - switch (id) { + switch (ppmu_events[i].id) { case PPMU_PMNCNT0: case PPMU_PMNCNT1: case PPMU_PMNCNT2: