From patchwork Mon Nov 4 14:22:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 178428 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1550086ilf; Mon, 4 Nov 2019 06:23:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzA+6C8Xwqts7OZdyfTXmzZNZQTv1oyy1yzLK0iWJ9Zl6L+3nLZgJn4M7Wwy8ol3NXvbSib X-Received: by 2002:a05:6402:13cd:: with SMTP id a13mr9486366edx.57.1572877408843; Mon, 04 Nov 2019 06:23:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572877408; cv=none; d=google.com; s=arc-20160816; b=SN30Q6IiBoBdrDsS9qdor55miHomwwrpVi1Z+OT81TRsLWLozH/BNlbPFSeHu8spq7 PaoLRO/Dr2+ABmM1eo1Mnde+2Fv10eV7SYLXZpGMSJTwfQdn3C/nNQhk5qOMPqOCWU1S B/gJDN7hY7VOM9U4G+Z4OOU5ZHDNEyJQ1qd9YU1Ng0vEJZC/h1UDfV6555cLXp/DWg9h WOF/tFXI3Zb3x6lO+fSeQlr6oOeAxI5okZidVbebnqDrK4+WTWMdhJuGsXy+CbKW1dFP qsXsEA00BSup/4rysctjlyAabJ/aXOO8ujHoGbDA3nFo7HUFVnXs9xgft4u/bM4QTRfW p+Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=AYQmjw1hml4PgLOeoBhVnK0KUzQgdFHYdam43/ukq0I=; b=ZdkrQpKfSCMDrOaB07QziVXdjmo9/7uZ5Iv6laXOPhgZpKRb38hInnlsuOG8NDHV9Y 2Aj1mUVMK5cfmdiYVlNwAEn8CdxW34jU2N1wmAmZBIh794/l/QFKrR/C4VBU7o1PxLMe 3ociu7Br+6j6tcFgYq37xlaX+kBoRj6Z+GQhPsyeS/BSqQuN1R+DTLHG8go4xf0zder2 QyxO+WwwjDNJXl2+QrKd6CtB3OqYIuXsQpYh5B/xrwQnak+3qBKbtnEjavPr95WP0mEq +LVAX+Gz5eFcjYzuyDFV1yFF8SwFbg+tqu4Hk3MqK0YDphIDf6l/GV3Bp7154bsGn1m/ Eg9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S3i2Q4fX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k24si4642696ejv.111.2019.11.04.06.23.28; Mon, 04 Nov 2019 06:23:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S3i2Q4fX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728471AbfKDOXO (ORCPT + 26 others); Mon, 4 Nov 2019 09:23:14 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40583 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727788AbfKDOXO (ORCPT ); Mon, 4 Nov 2019 09:23:14 -0500 Received: by mail-wm1-f66.google.com with SMTP id f3so5153534wmc.5 for ; Mon, 04 Nov 2019 06:23:11 -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:in-reply-to:references; bh=AYQmjw1hml4PgLOeoBhVnK0KUzQgdFHYdam43/ukq0I=; b=S3i2Q4fX6BY/vftXH45Bc99xDs+PhLN+rFNVjkaSXNvPIOcaObXh98ZRLk6FuLNIt7 QHpDzSO+OT5ZzIZB6HH/sBpt1DJEDSZtedrQ6Xw8LhRJxD2YpByzTNoVAhjcB94JeR51 1Phyh+Y4Y0B/4KMf2HtXwwEnPE10dQDBPPDUAUqW6w1utmcOCu3qsfyuNBQAmnqXv4UM 74VYY7PNPjuKQcXphTytfOFelwan4Ftgq8A2pyy96Syt5JPYiqdMiNEU9A5X7N0mpvns 0Cqw/TnrQDbAi6b825YLN8CER7MTbIFlEobifc2R9BH/FDDEE6zIKIf+4savGyYhzMQY QHVA== 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=AYQmjw1hml4PgLOeoBhVnK0KUzQgdFHYdam43/ukq0I=; b=Y1pFwhpmzoKhthfzmATTeS8itODXRyY3i5tpznXffb0UrwVwdnyibvlMaBmIUcp7AT h72KpZHGsXY1fxPIHC3EVB1MJ25poZSWFwtQjqvZHUQoAokoBBfOcXVFNSS3rdOnt39J Jw7NDwW7gb6iMXs+lPRzpCjDInYyIxAcCZ0rEAj0qmBDzv3YFsozuF/yR/chCDSkNEZl v5Hy6s0hoLWDe379lMchUlXTN1e6gIM4aqN+WC8V9HfdYcQbOKwSgIiCflGoCcKsHYdL 93RfD6yOLweSACFruKSsFKVTH5z0VGX7jchxF1D6ib67urlaXoZl5jfCnxCz2wfIpuQt uvsg== X-Gm-Message-State: APjAAAWkDf3i9ur8O3O9BXlHVVKIOStu6Zi+foKWWROKYb726XW07uqL aDtXCJFpufBmS18wgWSVlvmfsQ== X-Received: by 2002:a7b:c444:: with SMTP id l4mr22376340wmi.21.1572877390929; Mon, 04 Nov 2019 06:23:10 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:58da:b044:f184:d281]) by smtp.gmail.com with ESMTPSA id l18sm21692446wrn.48.2019.11.04.06.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 06:23:10 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 1/5] clocksource/drivers/timer-of: Convert last full_name to %pOF Date: Mon, 4 Nov 2019 15:22:53 +0100 Message-Id: <20191104142257.30029-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <6fd4d800-b1f8-d757-458e-23742d20884c@linaro.org> References: <6fd4d800-b1f8-d757-458e-23742d20884c@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven Commit 469869d18a886e04 ("clocksource: Convert to using %pOF instead of full_name") converted all but the one just added before by commit 32f2fea6e77e64cd ("clocksource/drivers/timer-of: Handle of_irq_get_byname() result correctly"). Signed-off-by: Geert Uytterhoeven Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20191016144747.29538-2-geert+renesas@glider.be --- drivers/clocksource/timer-of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index d8c2bd4391d0..384394205a12 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -55,8 +55,8 @@ static __init int timer_of_irq_init(struct device_node *np, if (of_irq->name) { of_irq->irq = ret = of_irq_get_byname(np, of_irq->name); if (ret < 0) { - pr_err("Failed to get interrupt %s for %s\n", - of_irq->name, np->full_name); + pr_err("Failed to get interrupt %s for %pOF\n", + of_irq->name, np); return ret; } } else { From patchwork Mon Nov 4 14:22:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 178424 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1549845ilf; Mon, 4 Nov 2019 06:23:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwWcokdK5szLEOtyMsb15ApbJ+iSGORdIoXOtd+AzUC46+lL+CJ+ys8mFXzQxXKKvzBjk8N X-Received: by 2002:a17:906:73d5:: with SMTP id n21mr24133023ejl.228.1572877397153; Mon, 04 Nov 2019 06:23:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572877397; cv=none; d=google.com; s=arc-20160816; b=JH/MpGmyLPYR0lDH0pCzKJo6ZvNty1rqyaUu6Z5D4x17axF09nxaUUpEtLoWnRcb7Q sfMHU/Z/GTNLD37QwtoonpmWqg+yW8PVhjcwoBSnKzSl8vHYGwoIA6oNx0d3jTjy5hbo Gy6HgWbsQP4bYlQ8qun85uDF+FUAHffiIY5GlXgc3+iqK1FpwMSrPpRCUZiws9X3cLNS bogoqYh8ff0bQo1I0VIGAdwAJJwZz018xiorx+bkpham6LgqL0lLPC5+i0URyf5fpvgL mC4G/jW7YDnB0NHWtAI7vY/6a6itiisqTCc60gyEjzmsmSOOci2xCjfgAgLZapm29CTq A0Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=IHh6fuwY3ylN/KSaO/LHxSOUYpoJDg0CwXgvso5hvT8=; b=bWJ3YjuXTCTyhS0DcRooTMZcJq1ANXvzVQ8IZhKpD+pqxQ4QK/TJgQx3G0OKmRPBmM SIRvlO1CHcI+eamXAdGbd2FvCgYkZl+72cFSHcwe3Tcj5RPhkCQlmoy5CLmlHhmW40XQ Aq/WrzmVZV4VJVmtQTAq6Q9fvXKGAruW1Jbu0/X2nF+2DB4QqMy6Ab2LXQiNBYWbqCEC OBv2SqWLDDWgXaZ8WN7NmwL/UCjG6WrkrFEp8pZEMYRscM/Eb70fpbVTuwiWQ5JqIl0j BnAd8447SXgSyGfFsBzsIBCUumMXLzbGcl+mwl4volmbMfJMkE0DhdyFpxNOA8h7FyLH fmww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ibY+rbHF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id me8si1327868ejb.382.2019.11.04.06.23.16; Mon, 04 Nov 2019 06:23:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ibY+rbHF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728604AbfKDOXO (ORCPT + 26 others); Mon, 4 Nov 2019 09:23:14 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52026 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727861AbfKDOXO (ORCPT ); Mon, 4 Nov 2019 09:23:14 -0500 Received: by mail-wm1-f67.google.com with SMTP id q70so16867448wme.1 for ; Mon, 04 Nov 2019 06:23:12 -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:in-reply-to:references; bh=IHh6fuwY3ylN/KSaO/LHxSOUYpoJDg0CwXgvso5hvT8=; b=ibY+rbHF6z4Lp5b+pP9zccaPS6WWiB75TppTIb7c2ZOisGdb0fhUdF8j7cGz0o4er+ dP5qBrtRUSfQ8bkQD+Go3NpQkku3cZ+OSjtDByFcqsimG22zHG5Wp3usevvm4HIvRkYJ ho1qT2BNanAvggF3aLlE2ItW2pzJkSq/y0yvZW0IOjVIwc0SO0NRZN7pWzSCJg0k33zL /Vnsu1GpVSG6WYThaWicCaBoMxuxpyVZaaW9/ISMaCbJ5YNOe6W+g0l2yoY3uE0yLd19 P6PFFhUkgmLvaGspjmEbMLddFu22Kkk1RS8Rv9nx68wVneoLVPArW7kd9AaTNxOyL6Ni RPvw== 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=IHh6fuwY3ylN/KSaO/LHxSOUYpoJDg0CwXgvso5hvT8=; b=I+lmgwb4CvPNhk73EgBytPbugpXldlhrzBRghTdzASPErdQFmjrbvroF1Hm0+guKhq zmaIdLmNbFrqCXwm44YAmdBlJThxrDgtnB9nUARO+mJTzGUBziZcHvLedFrErUNj3oTl ZDLl8dbTDV2rgZrh9Hc4fm3XmAIvHDi+RruLjpzt7HA5EALo6JZvLRitZVgP2fEdB4ky srBpIE/CG2KWQFyWWVQihAYlhl/U1KTU08A7cZdnAFgiPZbw2sZibNLvAtXNuHgW008M df5fHbDPVZ3fnIzZW52OamNj2F179RRBhXcGV2XVrJYzdzQeFX4gsRakDlqO5YarUXir IJ9w== X-Gm-Message-State: APjAAAVodpXHdlvTBfJnw4BoQVepIpRkXr/L5L8cN54/zHMvWEsi6EwT 2b3rJlcFjMOXwScRuiCm7TiMCQ== X-Received: by 2002:a1c:7709:: with SMTP id t9mr16691798wmi.80.1572877392037; Mon, 04 Nov 2019 06:23:12 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:58da:b044:f184:d281]) by smtp.gmail.com with ESMTPSA id l18sm21692446wrn.48.2019.11.04.06.23.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 06:23:11 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/5] clocksource/drivers/timer-of: Use unique device name instead of timer Date: Mon, 4 Nov 2019 15:22:54 +0100 Message-Id: <20191104142257.30029-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191104142257.30029-1-daniel.lezcano@linaro.org> References: <6fd4d800-b1f8-d757-458e-23742d20884c@linaro.org> <20191104142257.30029-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven If a hardware-specific driver does not provide a name, the timer-of core falls back to device_node.name. Due to generic DT node naming policies, that name is almost always "timer", and thus doesn't identify the actual timer used. Fix this by using device_node.full_name instead, which includes the unit addrees. Example impact on /proc/timer_list: -Clock Event Device: timer +Clock Event Device: timer@fcfec400 Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20191016144747.29538-3-geert+renesas@glider.be --- drivers/clocksource/timer-of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index 384394205a12..8c11bd743dd0 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -190,7 +190,7 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to) } if (!to->clkevt.name) - to->clkevt.name = np->name; + to->clkevt.name = np->full_name; to->np = np; From patchwork Mon Nov 4 14:22:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 178427 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1550045ilf; Mon, 4 Nov 2019 06:23:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzyCN4MmPB9GCqk/7MMyLe0kG7iIAgdJfO/aXO6vQEsYsDgCfinVcGbxyosUmklqcxaipwJ X-Received: by 2002:aa7:cdd1:: with SMTP id h17mr27632930edw.108.1572877407068; Mon, 04 Nov 2019 06:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572877407; cv=none; d=google.com; s=arc-20160816; b=AMWuJj7TMHbdPC3DEnbH3e+RDvyLPHagoOdLUH05EXCJBwfr18FfZarAVbaF0mkEjG c17fc8k1ObA8RycICQbO6Bcv8hwEiG5wHrUeufnAdqn24Krp/FHCwXfUpeM4iwYeDl6K cY9EDCWX01GU2Qd+srsJno6RKzE2I+0xoufzi87bs6YeOY48w4PrU/BojxbRcGBCVV72 BlDwFjJULhX3APGnmvgiPmGw2cqxuYMF7fRzz+dmAHFJzquAoVes5TClXtAi3ZSHLf0g 4IH6t41HDCIFoU3ErvNrlzRbGDKP6OeipRK4Xhq2ae9LNm09Cy0IZaVdnNSqIup4mEJl q30w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=8PT3lzS5kgHvAaeJFeb5r3uf3YM7EgRuHSrYbt0bMFk=; b=EeWtwXCUid+gLfXiZkNmw9tdnl2IZPQvOOgp86SFYf3p2shZxVJxm6vacSciftJX3x SYhCpRAPZBroxCapT1PpqsxjcIjxFmhPxQq6bBZxNVaDoeS/1vNi0jhbIgIR5j5uZBVo ICgZ4kcEX7Vn+UemKxijyJHk9+OJkSM/71ixYigF3aTq9eYd3qcmv5VZSlmLZR6PSGsB OZN2XskgmcmRt/b4tHsIuoDznSOucVNxQZL0D9QDGOebunYrkhh5RBXWBE3PuTK0Tsbh 91TEETJpSg4cWupsv/8iDk38rorDRjb0Hze8aC0h9fll47Y3/ZKeHGkQwx1dNfu3FrjJ vEfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SNkPRKZd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k24si4642696ejv.111.2019.11.04.06.23.26; Mon, 04 Nov 2019 06:23:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SNkPRKZd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728760AbfKDOXZ (ORCPT + 26 others); Mon, 4 Nov 2019 09:23:25 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46758 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727861AbfKDOXR (ORCPT ); Mon, 4 Nov 2019 09:23:17 -0500 Received: by mail-wr1-f67.google.com with SMTP id b3so11530184wrs.13 for ; Mon, 04 Nov 2019 06:23:14 -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:in-reply-to:references; bh=8PT3lzS5kgHvAaeJFeb5r3uf3YM7EgRuHSrYbt0bMFk=; b=SNkPRKZdYBvp+Jra5t5LVndKlS22wZNjS01AGgztYnVuSJdig02jSagBkDkPSGJ3VQ ieOLceDMwHWW6D8zYvxX80WnD/5CvAxzIXlxzrEZhA3ro4g6pGdTlJd6OJKGKGgLKQp9 VOPN3p4Czyv3Hva2rnNNsdqX516gIliU3ABxR6gHWjc/PI/NqupKLqBmAcQN+tjFzUiH 4ogMDxNFwHSAMDUCnYGafFEsnSlBIoabg41lMHjv/bI1McdsYdrooFSsshoqqOIpAoIk q2isgyU4wGAERUP78PrK1GwIbL8mBzYAUabQKZKzf8RrbbK4ccq2ZZq0X2sjj64zkwzk aF0Q== 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=8PT3lzS5kgHvAaeJFeb5r3uf3YM7EgRuHSrYbt0bMFk=; b=lKHuqLOcRF4mYrEXFYjB64V7HA/zQ+CuGurUq8XFq1J6ult8FRrsnLVSdLdMamt821 sborq9aAeQNLDsYL33KswN+IGuQQZbYC0slK7WMCKEAFdbM/5lK5JbYNqqDw+o8Otcs3 QyXhE+ng1v6voXDVX7sb4HBtvKUTJ4de8qhDCxkb+JDteFi038ppF/r/9N/lR6ton63z PZm9uWjzUWXezKOy+uPqwd+kmm74nZR9qcCEt2lSp/wrot3N3tLMEdxbhlk1cxBvdZXI aXgwF1KgDrmGtyGtWOutsKMf8TUxMTphLF5CEeAu6Rn68bPyyvw/+R4Vj3U/XY77I9t/ 3JEQ== X-Gm-Message-State: APjAAAUatDyAE/QNfdKgUIZ3J9GbPsKpvbGAF4wOuiwacTlWszGofyE9 Fb052gWqrmyHQvEdZFgPtBnntw== X-Received: by 2002:adf:e8ca:: with SMTP id k10mr10060725wrn.377.1572877393588; Mon, 04 Nov 2019 06:23:13 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:58da:b044:f184:d281]) by smtp.gmail.com with ESMTPSA id l18sm21692446wrn.48.2019.11.04.06.23.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 06:23:12 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com (moderated list:ARM/STM32 ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:ARM/STM32 ARCHITECTURE) Subject: [PATCH 3/5] clocksource/drivers/renesas-ostm: Convert to timer_of Date: Mon, 4 Nov 2019 15:22:55 +0100 Message-Id: <20191104142257.30029-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191104142257.30029-1-daniel.lezcano@linaro.org> References: <6fd4d800-b1f8-d757-458e-23742d20884c@linaro.org> <20191104142257.30029-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven Convert the Renesas OSTM driver to use the timer_of framework. This reduces the driver object size by 367 bytes (with gcc 7.4.0). Signed-off-by: Geert Uytterhoeven Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20191016144747.29538-4-geert+renesas@glider.be --- drivers/clocksource/Kconfig | 1 + drivers/clocksource/renesas-ostm.c | 189 +++++++++++------------------ 2 files changed, 73 insertions(+), 117 deletions(-) -- 2.17.1 diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index f35a53ce8988..5fdd76cb1768 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -528,6 +528,7 @@ config SH_TIMER_MTU2 config RENESAS_OSTM bool "Renesas OSTM timer driver" if COMPILE_TEST select CLKSRC_MMIO + select TIMER_OF help Enables the support for the Renesas OSTM. diff --git a/drivers/clocksource/renesas-ostm.c b/drivers/clocksource/renesas-ostm.c index 37c39b901bb1..46012d905604 100644 --- a/drivers/clocksource/renesas-ostm.c +++ b/drivers/clocksource/renesas-ostm.c @@ -6,14 +6,14 @@ * Copyright (C) 2017 Chris Brandt */ -#include -#include #include #include #include #include #include +#include "timer-of.h" + /* * The OSTM contains independent channels. * The first OSTM channel probed will be set up as a free running @@ -24,12 +24,6 @@ * driven clock event. */ -struct ostm_device { - void __iomem *base; - unsigned long ticks_per_jiffy; - struct clock_event_device ced; -}; - static void __iomem *system_clock; /* For sched_clock() */ /* OSTM REGISTERS */ @@ -47,41 +41,32 @@ static void __iomem *system_clock; /* For sched_clock() */ #define CTL_ONESHOT 0x02 #define CTL_FREERUN 0x02 -static struct ostm_device *ced_to_ostm(struct clock_event_device *ced) -{ - return container_of(ced, struct ostm_device, ced); -} - -static void ostm_timer_stop(struct ostm_device *ostm) +static void ostm_timer_stop(struct timer_of *to) { - if (readb(ostm->base + OSTM_TE) & TE) { - writeb(TT, ostm->base + OSTM_TT); + if (readb(timer_of_base(to) + OSTM_TE) & TE) { + writeb(TT, timer_of_base(to) + OSTM_TT); /* * Read back the register simply to confirm the write operation * has completed since I/O writes can sometimes get queued by * the bus architecture. */ - while (readb(ostm->base + OSTM_TE) & TE) + while (readb(timer_of_base(to) + OSTM_TE) & TE) ; } } -static int __init ostm_init_clksrc(struct ostm_device *ostm, unsigned long rate) +static int __init ostm_init_clksrc(struct timer_of *to) { - /* - * irq not used (clock sources don't use interrupts) - */ - - ostm_timer_stop(ostm); + ostm_timer_stop(to); - writel(0, ostm->base + OSTM_CMP); - writeb(CTL_FREERUN, ostm->base + OSTM_CTL); - writeb(TS, ostm->base + OSTM_TS); + writel(0, timer_of_base(to) + OSTM_CMP); + writeb(CTL_FREERUN, timer_of_base(to) + OSTM_CTL); + writeb(TS, timer_of_base(to) + OSTM_TS); - return clocksource_mmio_init(ostm->base + OSTM_CNT, - "ostm", rate, - 300, 32, clocksource_mmio_readl_up); + return clocksource_mmio_init(timer_of_base(to) + OSTM_CNT, "ostm", + timer_of_rate(to), 300, 32, + clocksource_mmio_readl_up); } static u64 notrace ostm_read_sched_clock(void) @@ -89,87 +74,75 @@ static u64 notrace ostm_read_sched_clock(void) return readl(system_clock); } -static void __init ostm_init_sched_clock(struct ostm_device *ostm, - unsigned long rate) +static void __init ostm_init_sched_clock(struct timer_of *to) { - system_clock = ostm->base + OSTM_CNT; - sched_clock_register(ostm_read_sched_clock, 32, rate); + system_clock = timer_of_base(to) + OSTM_CNT; + sched_clock_register(ostm_read_sched_clock, 32, timer_of_rate(to)); } static int ostm_clock_event_next(unsigned long delta, - struct clock_event_device *ced) + struct clock_event_device *ced) { - struct ostm_device *ostm = ced_to_ostm(ced); + struct timer_of *to = to_timer_of(ced); - ostm_timer_stop(ostm); + ostm_timer_stop(to); - writel(delta, ostm->base + OSTM_CMP); - writeb(CTL_ONESHOT, ostm->base + OSTM_CTL); - writeb(TS, ostm->base + OSTM_TS); + writel(delta, timer_of_base(to) + OSTM_CMP); + writeb(CTL_ONESHOT, timer_of_base(to) + OSTM_CTL); + writeb(TS, timer_of_base(to) + OSTM_TS); return 0; } static int ostm_shutdown(struct clock_event_device *ced) { - struct ostm_device *ostm = ced_to_ostm(ced); + struct timer_of *to = to_timer_of(ced); - ostm_timer_stop(ostm); + ostm_timer_stop(to); return 0; } static int ostm_set_periodic(struct clock_event_device *ced) { - struct ostm_device *ostm = ced_to_ostm(ced); + struct timer_of *to = to_timer_of(ced); if (clockevent_state_oneshot(ced) || clockevent_state_periodic(ced)) - ostm_timer_stop(ostm); + ostm_timer_stop(to); - writel(ostm->ticks_per_jiffy - 1, ostm->base + OSTM_CMP); - writeb(CTL_PERIODIC, ostm->base + OSTM_CTL); - writeb(TS, ostm->base + OSTM_TS); + writel(timer_of_period(to) - 1, timer_of_base(to) + OSTM_CMP); + writeb(CTL_PERIODIC, timer_of_base(to) + OSTM_CTL); + writeb(TS, timer_of_base(to) + OSTM_TS); return 0; } static int ostm_set_oneshot(struct clock_event_device *ced) { - struct ostm_device *ostm = ced_to_ostm(ced); + struct timer_of *to = to_timer_of(ced); - ostm_timer_stop(ostm); + ostm_timer_stop(to); return 0; } static irqreturn_t ostm_timer_interrupt(int irq, void *dev_id) { - struct ostm_device *ostm = dev_id; + struct clock_event_device *ced = dev_id; - if (clockevent_state_oneshot(&ostm->ced)) - ostm_timer_stop(ostm); + if (clockevent_state_oneshot(ced)) + ostm_timer_stop(to_timer_of(ced)); /* notify clockevent layer */ - if (ostm->ced.event_handler) - ostm->ced.event_handler(&ostm->ced); + if (ced->event_handler) + ced->event_handler(ced); return IRQ_HANDLED; } -static int __init ostm_init_clkevt(struct ostm_device *ostm, int irq, - unsigned long rate) +static int __init ostm_init_clkevt(struct timer_of *to) { - struct clock_event_device *ced = &ostm->ced; - int ret = -ENXIO; - - ret = request_irq(irq, ostm_timer_interrupt, - IRQF_TIMER | IRQF_IRQPOLL, - "ostm", ostm); - if (ret) { - pr_err("ostm: failed to request irq\n"); - return ret; - } + struct clock_event_device *ced = &to->clkevt; - ced->name = "ostm"; ced->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC; ced->set_state_shutdown = ostm_shutdown; ced->set_state_periodic = ostm_set_periodic; @@ -178,79 +151,61 @@ static int __init ostm_init_clkevt(struct ostm_device *ostm, int irq, ced->shift = 32; ced->rating = 300; ced->cpumask = cpumask_of(0); - clockevents_config_and_register(ced, rate, 0xf, 0xffffffff); + clockevents_config_and_register(ced, timer_of_rate(to), 0xf, + 0xffffffff); return 0; } static int __init ostm_init(struct device_node *np) { - struct ostm_device *ostm; - int ret = -EFAULT; - struct clk *ostm_clk = NULL; - int irq; - unsigned long rate; - - ostm = kzalloc(sizeof(*ostm), GFP_KERNEL); - if (!ostm) - return -ENOMEM; - - ostm->base = of_iomap(np, 0); - if (!ostm->base) { - pr_err("ostm: failed to remap I/O memory\n"); - goto err; - } - - irq = irq_of_parse_and_map(np, 0); - if (irq < 0) { - pr_err("ostm: Failed to get irq\n"); - goto err; - } + struct timer_of *to; + int ret; - ostm_clk = of_clk_get(np, 0); - if (IS_ERR(ostm_clk)) { - pr_err("ostm: Failed to get clock\n"); - ostm_clk = NULL; - goto err; - } + to = kzalloc(sizeof(*to), GFP_KERNEL); + if (!to) + return -ENOMEM; - ret = clk_prepare_enable(ostm_clk); - if (ret) { - pr_err("ostm: Failed to enable clock\n"); - goto err; + to->flags = TIMER_OF_BASE | TIMER_OF_CLOCK; + if (system_clock) { + /* + * clock sources don't use interrupts, clock events do + */ + to->flags |= TIMER_OF_IRQ; + to->of_irq.flags = IRQF_TIMER | IRQF_IRQPOLL; + to->of_irq.handler = ostm_timer_interrupt; } - rate = clk_get_rate(ostm_clk); - ostm->ticks_per_jiffy = DIV_ROUND_CLOSEST(rate, HZ); + ret = timer_of_init(np, to); + if (ret) + goto err_free; /* * First probed device will be used as system clocksource. Any * additional devices will be used as clock events. */ if (!system_clock) { - ret = ostm_init_clksrc(ostm, rate); - - if (!ret) { - ostm_init_sched_clock(ostm, rate); - pr_info("ostm: used for clocksource\n"); - } + ret = ostm_init_clksrc(to); + if (ret) + goto err_cleanup; + ostm_init_sched_clock(to); + pr_info("ostm: used for clocksource\n"); } else { - ret = ostm_init_clkevt(ostm, irq, rate); + ret = ostm_init_clkevt(to); + if (ret) + goto err_cleanup; - if (!ret) - pr_info("ostm: used for clock events\n"); - } - -err: - if (ret) { - clk_disable_unprepare(ostm_clk); - iounmap(ostm->base); - kfree(ostm); - return ret; + pr_info("ostm: used for clock events\n"); } return 0; + +err_cleanup: + timer_of_cleanup(to); +err_free: + kfree(to); + return ret; } TIMER_OF_DECLARE(ostm, "renesas,ostm", ostm_init); From patchwork Mon Nov 4 14:22:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 178425 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1549926ilf; Mon, 4 Nov 2019 06:23:21 -0800 (PST) X-Google-Smtp-Source: APXvYqyi+3vyOncMgkixmOhjihCF08vSgKqGgPxv7F1VCvUx2uo+BhGUtXs2h0hfhWPuXANrTWzA X-Received: by 2002:a50:c30d:: with SMTP id a13mr26440962edb.177.1572877401403; Mon, 04 Nov 2019 06:23:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572877401; cv=none; d=google.com; s=arc-20160816; b=RMdmpM4HB2XkWSbHXb0Wzm0SSSCyBJmvhSBfyI9+9M03ehpMArDiqvC3TqQv0ZAyZw Nx8WS8WoYFURUNpYKVxY0AX9iGSy3JpfNg39OcHSrIi2V0mYemDPtzabQeNJFbWy2ENB vKsJFPt2BLyFt9pSUB8FSZT8bZcuXjdhok3QBrHsCsjepFlFUsr2NnmgIf5UPL1owGrn 6GGlaEpt4Xh10t11VLXS5Hd4jSYdohZ5/NVuvATww/FOnRSog3hgo/EmD5Y+ZA3MMdRw Bl/xV0rAwkWnt2PcH0fZP3s/Yxa6ldsEjZtxLdpwYATidEoJkntNhZAl0qsoizGBbK2H XmYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DlHGsHCYz6i9keGsLrYM+8DrDokVvhA17QRfhwApon4=; b=KZshQurWX/oGKqX1BbtJQMNXYpmxOTjQ8bLonRwUwE/EpEz6ti39HkDpDewSllKu+c UGFSiouom/OR7TMTeXXrBn88jEODWHToKBz/PNk+kwLUnSx1sW4dBa+OlJ8kq2KXa0we T09uAngfm9p8kG2ZyEEEtZJlgLjj8ehbZGD+J0JrqJvD8puS/+U6BQfpHePfy+okG8DA OTf5oaUGdMPCOTZkLPA/t7FxKDesCHKfIXg+UHSdWhtuAFkXbSqV+878aUtbCHP6RMPo kDWSMKqDCgJlQqeqoHRxvxe5CaP20nYc7r+C/AJ5eRwz1BX5HZJV41rFpL5hUjwmX+W+ coHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pformDiS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k24si4642696ejv.111.2019.11.04.06.23.21; Mon, 04 Nov 2019 06:23:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pformDiS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728666AbfKDOXR (ORCPT + 26 others); Mon, 4 Nov 2019 09:23:17 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39702 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728624AbfKDOXQ (ORCPT ); Mon, 4 Nov 2019 09:23:16 -0500 Received: by mail-wm1-f67.google.com with SMTP id t26so12181106wmi.4 for ; Mon, 04 Nov 2019 06:23:15 -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:in-reply-to:references; bh=DlHGsHCYz6i9keGsLrYM+8DrDokVvhA17QRfhwApon4=; b=pformDiSnMnhGM0gWYP61EL4IsZN5i5fQ20RPhOIcGPtbvADApmq3GGz3ONVTEshHm wUje680PA6qM1Er/+RfRn3rLoXyJ3NpKVfmdZ8nVsuKHtCIStEltZD9vqc8Gru0cEJLj BBXQmTmeGmCPA0FSuvLswr1oygRQXRacmKn6mMNa7Wj5mCsqwfQ7W3jvUbNWOjsPrE5C +s9Tr0F8RqgF+zp6uKjx9lunA6aY0/AHe3l7bor+KvIjirdp5ndgS/qnucYbOCKyo4IN EoV8o3HmWJqw6Ffth7CtcZB8UJLk0rlpMe4fCx0380dohUIF1SUGT2Ksbfsdn3hdIR+b f/RA== 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=DlHGsHCYz6i9keGsLrYM+8DrDokVvhA17QRfhwApon4=; b=DTOeZKLJaXDV2IczwL44pvL4PHSjahYfRh07mAGshD13yuX7gSlIViNTUcoaFHyr7j WU1rmGQqcuqfkiXVB7KbJs2ELkPFQ9pdoMH0ZbkldvNq37iJyPi/LHuQuNO1LXFVZXkM AFwsHrjISw7mRaU4zXVTUcXDvYyNUelUxxWtxHsNFrb2pepOUAy+gHFUGWT80x3E2j5e 0w6oyzIA78T7dZyQ/k88F7s/vn0o/SWwI8m9RBRu56atevcvZjo10Qixf5kXPI4MkpqX XTYETKb5JJMA4jkZ0+mFswYzLaktBTh0JVKb6XJ+qP2v4bHB5I0nQ+/eaC8qklCUMTJV og+Q== X-Gm-Message-State: APjAAAUXqDQ8qZJFOoEOUqKyFWKn+3XZyzVrGGUxVOmVa8wQilkJ+bcf EVg6524CWaaWKGTpC2a4u7h4IA== X-Received: by 2002:a7b:cc89:: with SMTP id p9mr21507045wma.99.1572877394844; Mon, 04 Nov 2019 06:23:14 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:58da:b044:f184:d281]) by smtp.gmail.com with ESMTPSA id l18sm21692446wrn.48.2019.11.04.06.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 06:23:14 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com (moderated list:ARM/STM32 ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:ARM/STM32 ARCHITECTURE) Subject: [PATCH 4/5] clocksource/drivers/renesas-ostm: Use unique device name instead of ostm Date: Mon, 4 Nov 2019 15:22:56 +0100 Message-Id: <20191104142257.30029-4-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191104142257.30029-1-daniel.lezcano@linaro.org> References: <6fd4d800-b1f8-d757-458e-23742d20884c@linaro.org> <20191104142257.30029-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven Currently all OSTM devices are called "ostm", also in kernel messages. As there can be multiple instances in an SoC, this can confuse the user. Hence construct a unique name from the DT node name, like is done for platform devices. On RSK+RZA1, the boot log changes like: -clocksource: ostm: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 57352151442 ns +clocksource: timer@fcfec000: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 57352151442 ns sched_clock: 32 bits at 33MHz, resolution 30ns, wraps every 64440619504ns -ostm: used for clocksource -ostm: used for clock events +/soc/timer@fcfec000: used for clocksource +/soc/timer@fcfec400: used for clock events ... -clocksource: Switched to clocksource ostm +clocksource: Switched to clocksource timer@fcfec000 Signed-off-by: Geert Uytterhoeven Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20191016144747.29538-5-geert+renesas@glider.be --- drivers/clocksource/renesas-ostm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/clocksource/renesas-ostm.c b/drivers/clocksource/renesas-ostm.c index 46012d905604..3d06ba66008c 100644 --- a/drivers/clocksource/renesas-ostm.c +++ b/drivers/clocksource/renesas-ostm.c @@ -64,9 +64,9 @@ static int __init ostm_init_clksrc(struct timer_of *to) writeb(CTL_FREERUN, timer_of_base(to) + OSTM_CTL); writeb(TS, timer_of_base(to) + OSTM_TS); - return clocksource_mmio_init(timer_of_base(to) + OSTM_CNT, "ostm", - timer_of_rate(to), 300, 32, - clocksource_mmio_readl_up); + return clocksource_mmio_init(timer_of_base(to) + OSTM_CNT, + to->np->full_name, timer_of_rate(to), 300, + 32, clocksource_mmio_readl_up); } static u64 notrace ostm_read_sched_clock(void) @@ -190,13 +190,13 @@ static int __init ostm_init(struct device_node *np) goto err_cleanup; ostm_init_sched_clock(to); - pr_info("ostm: used for clocksource\n"); + pr_info("%pOF: used for clocksource\n", np); } else { ret = ostm_init_clkevt(to); if (ret) goto err_cleanup; - pr_info("ostm: used for clock events\n"); + pr_info("%pOF: used for clock events\n", np); } return 0; From patchwork Mon Nov 4 14:22:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 178426 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1549933ilf; Mon, 4 Nov 2019 06:23:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzhu3gqmRMipwEPUeXIkUeLXqccNpfW1vzqOzFmnMi8NbZ+fIh7JLuhpWcnMA9wrAmfsgoE X-Received: by 2002:aa7:db82:: with SMTP id u2mr29281114edt.256.1572877401781; Mon, 04 Nov 2019 06:23:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572877401; cv=none; d=google.com; s=arc-20160816; b=J5ZLLChPmwTbxiOFxgku3+xGSCZ2/cBo9PKNiYwg7dq9krBWUMFeOzGVEsvP33kkSI ZZTzaKqYnxlA5C+RUgnU+Gh+zpfAwb1vkjA/7THycxXeSjgu28zoEMQx2PmbR2ibtgX1 QrhXAFLDT8HCjvWrfMtkF7K2WI5yOr7jwH3aOEu0+wnZnTM3VxPp5YBtmnVfUF67Kx4Q dumZ6EY9Gg9NChOm+kmrFl8UnOOEVaqfAfl6zV1hI2go5RSxmLbH9S8jOqTHU4m7ANzd 7LjscBy97+PrHspYsyEtbs9MzfUWPH8Omx093BUce5AOUyLTHu2cZjs8OHxVTtXYsY0D vDaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=o012SHvPj5zgU3QBeDKlShRnobqJxcJuQYC3/1lC2yI=; b=EMtj0qQmhrvI/pvSadYemHTXT4mcEapTOQ6rz63U/1QxcMSy/3q0i08qliE8D23wCS d4cOrYLA+2hv2ROgA53+ccOZvJnIDOQMPO2CDM6dlkr8fxYIDNTlJRKqZPRtzYw7osVU 7msrrH5hhBr8nv1NPowhdjWFYlBz4zj0yuBdcpKQ60ZR1ylyi71XjkhAJMzfYIlNx7oJ bTAw8GiO0zhEIfPXoiPWeRxmXFm3HrnzDH2gTy8+VlNxjttDq1mjRTx3MQLrpWkzdnPt A7tdlSKfEJO/41ocSAOqmiNeMo93owDLzoS3O37Y0hHk11GlAcwvWJsJnkqfSpTt5k7K 7Jsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="P6v8/SKz"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k24si4642696ejv.111.2019.11.04.06.23.21; Mon, 04 Nov 2019 06:23:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="P6v8/SKz"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbfKDOXU (ORCPT + 26 others); Mon, 4 Nov 2019 09:23:20 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37911 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728630AbfKDOXS (ORCPT ); Mon, 4 Nov 2019 09:23:18 -0500 Received: by mail-wm1-f68.google.com with SMTP id z19so12099910wmk.3 for ; Mon, 04 Nov 2019 06:23:16 -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:in-reply-to:references; bh=o012SHvPj5zgU3QBeDKlShRnobqJxcJuQYC3/1lC2yI=; b=P6v8/SKz37UVfswKof2UASy8k/JJK8EJbfOp9D8iXlt7Orgu1ThjaodbG9fslrMQnO zVVgmQvVkolxffNUUqOeFea48ZDitteEuJhG3qqC3ivv0Bb/Nm7ueV+tCL2kh7xugyE+ Pz/84pvIkRFpVBikcM3KyEr0cBtdEUVxg+8fY2zharmNIJNt/6aPH3BW+bYaaBJeABj7 8xfSmSyNswgjhaytWeLRpc/CYXqkN03SrAUkPoXkrVeKpLoIgk08VNp1jqJI7RuyX9AS DhVi7LBxLRaK+iyyZ6we6XAANJBMKO0Gyu6gvpAOfp6UIDMYcwSyvFii9vNgL6BGeW5J DjIg== 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=o012SHvPj5zgU3QBeDKlShRnobqJxcJuQYC3/1lC2yI=; b=TmP3NatUd2QY2j3kjCNgL95mJJQUAYKqBJDeZNFpydFlY2tBfNpJz4SDfelYfhwBCw gm3Cyd3Omk6o4/4Ypht6Vauj76UAgZEu9nXA9UroQtRX/NFB37a6ko/tO/ZqKephwky6 Lz4AoEwigOX71Ck+epscxm+gll1Qxni74SYbhVgpZQsVHyWskqh0XwbcHFLkvIAO1qZa gbND1NYTt+dz85Qzjjsqs5mawVX+SXTG3aJNiw3Sq3BV2bxuGFZ887aMVk0QsWUfcsKM k6sqBgIIygS2ceKFuq0Nw/Vs3iIFsoLaaA5OeyJlNg2BXV4AM80KcUxIgT6xvfrq8hNB UOpg== X-Gm-Message-State: APjAAAXtmAajWLdZ4gh7Db365uMx3kFfuVPm6dXmEywxyW/nCRR3Wl4X gm1t9oyemGqDqJAVH4LsHrddPA== X-Received: by 2002:a7b:cc86:: with SMTP id p6mr23222709wma.116.1572877395942; Mon, 04 Nov 2019 06:23:15 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:58da:b044:f184:d281]) by smtp.gmail.com with ESMTPSA id l18sm21692446wrn.48.2019.11.04.06.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 06:23:15 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH 5/5] clocksource/drivers/asm9260: Add a check for of_clk_get Date: Mon, 4 Nov 2019 15:22:57 +0100 Message-Id: <20191104142257.30029-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191104142257.30029-1-daniel.lezcano@linaro.org> References: <6fd4d800-b1f8-d757-458e-23742d20884c@linaro.org> <20191104142257.30029-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuhong Yuan asm9260_timer_init misses a check for of_clk_get. Add a check for it and print errors like other clocksource drivers. Signed-off-by: Chuhong Yuan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20191016124330.22211-1-hslester96@gmail.com --- drivers/clocksource/asm9260_timer.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/drivers/clocksource/asm9260_timer.c b/drivers/clocksource/asm9260_timer.c index 9f09a59161e7..5b39d3701fa3 100644 --- a/drivers/clocksource/asm9260_timer.c +++ b/drivers/clocksource/asm9260_timer.c @@ -194,6 +194,10 @@ static int __init asm9260_timer_init(struct device_node *np) } clk = of_clk_get(np, 0); + if (IS_ERR(clk)) { + pr_err("Failed to get clk!\n"); + return PTR_ERR(clk); + } ret = clk_prepare_enable(clk); if (ret) {