From patchwork Thu Dec 6 09:39:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10715529 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 6904E14E2 for ; Thu, 6 Dec 2018 09:39:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 587342DEE7 for ; Thu, 6 Dec 2018 09:39:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49BBA2DFB3; Thu, 6 Dec 2018 09:39:30 +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 37BF42DEE7 for ; Thu, 6 Dec 2018 09:39:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727783AbeLFJjY (ORCPT ); Thu, 6 Dec 2018 04:39:24 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:35942 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727575AbeLFJjX (ORCPT ); Thu, 6 Dec 2018 04:39:23 -0500 Received: by mail-wm1-f68.google.com with SMTP id a18so297983wmj.1 for ; Thu, 06 Dec 2018 01:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=d1+BTdxj2KV5OgO7Eh6W4io7PjLKDST3CdGEejtC8Ek=; b=dSh4XoBP8vXWpfC9HCta3u+XGs3mBkgTnmWZxZ29DeeQ4ctzubRlMVn4ewPLPdbVju 8oVHRcbDYqNytGck5LGb18FLlAzgBHpRrekM/paGu/hpCS2tXWUFi2Nf5YtkqqxfkSsk zE+5QUZV22v9hBI7LZ9M7XxTk1YPzt6fLmHaQ= 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:mime-version :content-transfer-encoding; bh=d1+BTdxj2KV5OgO7Eh6W4io7PjLKDST3CdGEejtC8Ek=; b=dYk6j5Dh8SVrsaLDR2oQfP5WGyLv1r1cabHDP9KdEtTzQaJ+oG9m6jfuTvhC1opafi /Lzme33BQSp43lLcjPWh9rVJ0K8YH4pDrukTXFLKPNQW+qifcan4xCrFJHC6ZB5Zy0TM t8LP2NCuzlPXH/oW6Dl9S8KTUA9TTPD0V4qV+MDdqg2smLO6U1EBAGvjtE4UmLh9oXSt jwpNcC+yubNKJ2DigkyzkNGzwK38+qIlhjqi2DCbLtXvHGTB0biTx0WdTpdnCfDA3/77 XAhJDMkUTQraMgG1wfpvttaYYEUSs6VHkHYz8fvWRpxup1q7yPwTy9HfmUEE7FTgcs2A uSCA== X-Gm-Message-State: AA+aEWaqIYlAgASDDsnxdc+TL992rOWAzbk5MYfNNndNyNSvzjJNnGVQ SWlmedDfEKqngDptZjMB4bq09g== X-Google-Smtp-Source: AFSGD/W/39Muwb1Br8jLL2DVpYMQotDzUpQyipo9NcNjuElD3RzP0+oVW6/i36ia5VdZqqwOPQoOdw== X-Received: by 2002:a1c:4c0c:: with SMTP id z12mr14769713wmf.17.1544089161511; Thu, 06 Dec 2018 01:39:21 -0800 (PST) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id o81sm378003wmd.10.2018.12.06.01.39.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Dec 2018 01:39:20 -0800 (PST) From: Srinivas Kandagatla To: amit.kucheria@linaro.org, edubezval@gmail.com Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, daniel.lezcano@linaro.org, Srinivas Kandagatla Subject: [PATCH v2] thermal: tsens: qcom: do not create duplicate regmap debugfs entries Date: Thu, 6 Dec 2018 09:39:17 +0000 Message-Id: <20181206093917.26610-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 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 Regmap would use device name to create debugfs entries. If the device has multiple regmaps it is recommended to use name field in regmap_config. Fix this by providing name to the regmap configs correctly. Without this patch we would see below error on DB820c. qcom-tsens 4a9000.thermal-sensor: Failed to create 4a9000.thermal-sensor debugfs directory Signed-off-by: Srinivas Kandagatla Acked-by: Amit Kucheria Tested-by: Amit Kucheria Reviewed-by: Bjorn Andersson --- Changes since v1: -rename tsens_config to tsens_tm_config as suggested by Amit. drivers/thermal/qcom/tsens-common.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 3be4be2e0465..ddfdf88ffb4e 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -113,7 +113,15 @@ int get_temp_common(struct tsens_device *tmdev, int id, int *temp) return 0; } -static const struct regmap_config tsens_config = { +static const struct regmap_config tsens_tm_config = { + .name = "tm", + .reg_bits = 32, + .val_bits = 32, + .reg_stride = 4, +}; + +static const struct regmap_config tsens_srot_config = { + .name = "srot", .reg_bits = 32, .val_bits = 32, .reg_stride = 4, @@ -139,8 +147,8 @@ int __init init_common(struct tsens_device *tmdev) if (IS_ERR(srot_base)) return PTR_ERR(srot_base); - tmdev->srot_map = devm_regmap_init_mmio(tmdev->dev, - srot_base, &tsens_config); + tmdev->srot_map = devm_regmap_init_mmio(tmdev->dev, srot_base, + &tsens_srot_config); if (IS_ERR(tmdev->srot_map)) return PTR_ERR(tmdev->srot_map); @@ -154,7 +162,8 @@ int __init init_common(struct tsens_device *tmdev) if (IS_ERR(tm_base)) return PTR_ERR(tm_base); - tmdev->tm_map = devm_regmap_init_mmio(tmdev->dev, tm_base, &tsens_config); + tmdev->tm_map = devm_regmap_init_mmio(tmdev->dev, tm_base, + &tsens_tm_config); if (IS_ERR(tmdev->tm_map)) return PTR_ERR(tmdev->tm_map);