Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp614531lqb; Wed, 29 May 2024 06:02:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVqHL2l7Z6RHoMGqLAvEyMTR/t1LdtWHUJHC7KucDsEHllR+YwPgBWa36qH8mrJojE+U4TisbRMVbobce0ihFJqqusA4+HbK37+lDcvmg== X-Google-Smtp-Source: AGHT+IEX3V12OG6xDAfyzNO0UBvnMaVgxRX61NiDONhzI2CWktL5Dh8rxjy2p39I4fxI5RR2jr6L X-Received: by 2002:a17:903:41c8:b0:1f4:b410:dc14 with SMTP id d9443c01a7336-1f4b410df0bmr75476745ad.67.1716987748520; Wed, 29 May 2024 06:02:28 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68222ea5a54si10687060a12.226.2024.05.29.06.02.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 06:02:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=KVTQ3Yk8; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-194119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194119-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5B8C7B2225F for ; Wed, 29 May 2024 12:56:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D43F12B93; Wed, 29 May 2024 12:56:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KVTQ3Yk8" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3EA610A03; Wed, 29 May 2024 12:56:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716987376; cv=none; b=q+8YcJ+cPGttXCf5trwTid44wvv3en2q3uxT1l1tR/iwsaH7assjczmQA+S5nTSF30X/G4lkTL8CEQ+63oOx+/YPVtKGENv9ZDZoNVMmffhplct1mpaNvzzoZ5RhX7IOZvwjbWwFsSX1XkkGHQOOQzK6vVt2hJenYO6euBROuJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716987376; c=relaxed/simple; bh=gz8z8N5bHTtjf1WXKP3VLR7zy+2ou75tSdQdUmX2Vx4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DUb0B9xOXxoMuH01AVMLxEZlGBXuUrooLiiQuc3cCnPj37fNkeTH+RZ8w3JBtwsyy4aMfLmnvoqbQcEwAVREWF/YUiEcDl+QfZQTute1igQWYb9dfvT504BD/qHemH7O4xpcQ6EjybLqcAuA+FwHIX8kH7tFEZcRmxtOC9Kun5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KVTQ3Yk8; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716987375; x=1748523375; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=gz8z8N5bHTtjf1WXKP3VLR7zy+2ou75tSdQdUmX2Vx4=; b=KVTQ3Yk8L6lLF0SlKKAnpEMyUVPKkDcnDzC9DQYWKx+Ee0D/j5wS8jWj aFE+70oEJD0vC9u1uUJTx/ampL9Tphh3THlJyyPS8Ukn4kn18vvVUsK8c 4s9mGPkKa1XoMOK/7X+qmVpTAseosXptqqlj7jbPtCoyc8I4jDU5KSXBV ZHmZgTGM5Q+ATf42JFns4GxYgQrNbEb9+5wFl2g4Q6y/E4ErrTyoJrPj7 8E8hN6wW4BQGj/jW3HIXeINSUo4GBUqncw1erGowPuuHp5DyryA0S1unS xhT7kAM7DoFzyHUDZK4LhEkHaj0jz1lqSUiNcammTvzyVDIKVtG8yVu1P g==; X-CSE-ConnectionGUID: BSG6Xos3Sp+uL1jtf0ROkw== X-CSE-MsgGUID: M3losH2pRy2/1+utwYVpyw== X-IronPort-AV: E=McAfee;i="6600,9927,11087"; a="13618479" X-IronPort-AV: E=Sophos;i="6.08,198,1712646000"; d="scan'208";a="13618479" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2024 05:56:13 -0700 X-CSE-ConnectionGUID: H5QcdFF9TbONM172UGdoGg== X-CSE-MsgGUID: zqE6bIAkQpSvlFOcfBHkJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,198,1712646000"; d="scan'208";a="35963852" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa008.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2024 05:56:00 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1sCIqP-0000000BnVT-2SiK; Wed, 29 May 2024 15:55:53 +0300 Date: Wed, 29 May 2024 15:55:53 +0300 From: Andy Shevchenko To: Yoshinori Sato Cc: linux-sh@vger.kernel.org, Damien Le Moal , Niklas Cassel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Thomas Gleixner , Bjorn Helgaas , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Greg Kroah-Hartman , Jiri Slaby , Magnus Damm , Daniel Lezcano , Rich Felker , John Paul Adrian Glaubitz , Lee Jones , Helge Deller , Heiko Stuebner , Neil Armstrong , Chris Morgan , Sebastian Reichel , Linus Walleij , Arnd Bergmann , Masahiro Yamada , Baoquan He , Andrew Morton , Guenter Roeck , Kefeng Wang , Stephen Rothwell , Azeem Shaikh , Guo Ren , Max Filippov , Jernej Skrabec , Herve Codina , Anup Patel , Jacky Huang , Hugo Villeneuve , Jonathan Corbet , Wolfram Sang , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Christophe JAILLET , Sam Ravnborg , Javier Martinez Canillas , Sergey Shtylyov , Laurent Pinchart , linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, linux-serial@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: Re: [DO NOT MERGE v8 08/36] clocksource: sh_tmu: CLOCKSOURCE support. Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Wed, May 29, 2024 at 05:00:54PM +0900, Yoshinori Sato wrote: > Allows initialization as CLOCKSOURCE. .. > - dev_info(&ch->tmu->pdev->dev, "ch%u: used for %s clock events\n", > - ch->index, periodic ? "periodic" : "oneshot"); > + pr_info("%s ch%u: used for %s clock events\n", > + ch->tmu->name, ch->index, periodic ? "periodic" : "oneshot"); This is a step back change. We should use dev_*() if we have a device available. And I believe this is the case (at least for the previous boards), no? .. > - ch->irq = platform_get_irq(tmu->pdev, index); > + if (tmu->np) > + ch->irq = of_irq_get(tmu->np, index); > + else if (tmu->pdev) > + ch->irq = platform_get_irq(tmu->pdev, index); I found these changes counterproductive. Instead better to have up to three files to cover: - the common code (library) - the platform device support - the pure OF support. .. > - res = platform_get_resource(tmu->pdev, IORESOURCE_MEM, 0); > - if (!res) { > - dev_err(&tmu->pdev->dev, "failed to get I/O memory\n"); > - return -ENXIO; > + if (tmu->pdev) { > + res = platform_get_resource(tmu->pdev, IORESOURCE_MEM, 0); > + if (!res) { > + pr_err("sh_tmu failed to get I/O memory\n"); > + return -ENXIO; > + } > + > + tmu->mapbase = ioremap(res->start, resource_size(res)); devm_platform_ioremap_resource() should be good to have. Again, consider proper splitting. > } > + if (tmu->np) > + tmu->mapbase = of_iomap(tmu->np, 0); So, how many boards are non-OF compatible? Maybe makes sense to move them to OF and drop these platform code entirely from everywhere? .. > + tmu->name = dev_name(&pdev->dev); > + tmu->clk = clk_get(&tmu->pdev->dev, "fck"); devm_ approach can help a lot in case of platform device code. > + if (IS_ERR(tmu->clk)) { > + dev_err(&tmu->pdev->dev, "cannot get clock\n"); > + return PTR_ERR(tmu->clk); return dev_err_probe() ? > + } -- With Best Regards, Andy Shevchenko