From patchwork Thu Aug 22 16:14:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13773914 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 3F8A91CB300; Thu, 22 Aug 2024 16:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724343302; cv=none; b=iOlUEfuK9YgQ/cELi5gtdXG6B/hcVNKZ/BLfT4tUcS03ZQHzEgun8190VYR71M/GgLUCFb+4VdG6iB+wSAEdiBQF4QcDfifYyZr/6D8XcVqW04i8Lvy8XD5TQsaE6bEytDIzBXlSBFDslPdbPd2b784jeLmuWvY1aLZJBcffMik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724343302; c=relaxed/simple; bh=FF0VDIiosakR+PVPaqNYv9wsI4N3gnvo5w//z1e7Pfw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WgXP/Yz5P9TgSYPqEQn9hKQpXjBNhCHq1W9q+VSgUZJD0cMGAAPyqCCYqFwchMq6w+hk/3MbB3fNmCeJIwjCZgz1vy2zU91DQilPEbgcwiJeqQeg3mDuAxPZjA3klIK5Q+/vvvsWwz/24hTcUFWu+2s5UxctW1l4DG4MjvMTVuc= 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=gxi4aKZU; arc=none smtp.client-ip=198.175.65.10 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gxi4aKZU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724343302; x=1755879302; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FF0VDIiosakR+PVPaqNYv9wsI4N3gnvo5w//z1e7Pfw=; b=gxi4aKZUNd82ZKKmoQRdFO/wnqYvSrVzjj9iWuGObZEZdvZ/0vcDqinI bwFKHcwWXAi4nrUOQ+DafsdIU2ewGGayDrCoXHpOMZnIBSskRqRouATZc gTAaHCyab24jO/5lMCVwe+C3QRJaFurEKvRqlomOztU09Er6hFNCDD8Va E+pYMzu1286kUQ+bRlogNJTYq4DwLnJPxe9Ut5jPey9cw7zDzgsXE+rtF fMT5K+JlgA2PXCCIphjNKTKfq1evI2E1UMx7WfYoEveoVPYuBh/UgzZNU t8DW/mO71fb2jKTHycSY14ae8FXMpTqNqXUuxJWt5Z7TpsmabJZrunNsi A==; X-CSE-ConnectionGUID: /WQkN7UBRSqKBDRm1DqvXg== X-CSE-MsgGUID: yNx76kaERnSaJ7aS+WqPqw== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="40237247" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="40237247" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 09:15:00 -0700 X-CSE-ConnectionGUID: 0tlxdegFTXGdBISSHKftsA== X-CSE-MsgGUID: FsrnEt72Snign6a2Cyro4Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="66425276" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 22 Aug 2024 09:14:58 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 14D3E268; Thu, 22 Aug 2024 19:14:56 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Turquette , Stephen Boyd Subject: [PATCH v1 1/2] clk: x86: lpss-atom: Use predefined constants from units.h Date: Thu, 22 Aug 2024 19:14:07 +0300 Message-ID: <20240822161452.1780149-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240822161452.1780149-1-andriy.shevchenko@linux.intel.com> References: <20240822161452.1780149-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use predefined constants from units.h to make code robust against typos like how many zeros to put. Signed-off-by: Andy Shevchenko --- drivers/clk/x86/clk-lpss-atom.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/clk/x86/clk-lpss-atom.c b/drivers/clk/x86/clk-lpss-atom.c index aa9d0bb98f8b..c70088be72d1 100644 --- a/drivers/clk/x86/clk-lpss-atom.c +++ b/drivers/clk/x86/clk-lpss-atom.c @@ -12,20 +12,24 @@ #include #include #include +#include static int lpss_atom_clk_probe(struct platform_device *pdev) { struct lpss_clk_data *drvdata; struct clk *clk; + u32 rate; drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); if (!drvdata) return -ENOMEM; + /* Default frequency is 100MHz */ + rate = 100 * HZ_PER_MHZ; + /* LPSS free running clock */ drvdata->name = "lpss_clk"; - clk = clk_register_fixed_rate(&pdev->dev, drvdata->name, NULL, - 0, 100000000); + clk = clk_register_fixed_rate(&pdev->dev, drvdata->name, NULL, 0, rate); if (IS_ERR(clk)) return PTR_ERR(clk); From patchwork Thu Aug 22 16:14:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13773913 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 26E841DDF4; Thu, 22 Aug 2024 16:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724343301; cv=none; b=faCoJSUZbghBkhkt4HqVpWA1vVwt5zLnKh6zoUN77RqXnD0Rod2N5gTImgwreXHsL9StE5UrcVGsRycbBAjeZZOVjafMgEf4U+7bG22HoPoAuq+SKj/VCUZBJnzhpTQ5Tjbojjb0LRH0YOfOgiTH9pobkUH3oF8wAu8R0y7hUsE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724343301; c=relaxed/simple; bh=k+95UCNA2v0C0pm80mB06e3RVsToOTRByKAER4CdQKs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N558/RcJ5jLNBVR1znk5gCrSIy7arzcq7Kpm+ECqS+Y5zw+YacAJO0NCIC5VNjrDxz4dQXqDelR7XK+IRlFinE2nuoWlr+a/Z8C+4i67VoDOfNZLJWg3d49M90HyF3GLgE16pk4za1GjQ1RGlv5B5KpNjYacBPwr6z+NFV8VwxA= 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=MXn9DUHD; arc=none smtp.client-ip=198.175.65.11 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MXn9DUHD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724343301; x=1755879301; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=k+95UCNA2v0C0pm80mB06e3RVsToOTRByKAER4CdQKs=; b=MXn9DUHDcnasVTHg6ZUriZXTD3eyiu57w7EaS9phn7RCIMHBE8oQe+/4 uM5RyyrkCkfC6AJ7MbCNb9wMsUSu5L6ZVM7J2A6WlxUqWyycu/c+u1oS2 zq9pCC7GmHvGWcsJb1WEhs5WrhlNA+iWYYw2FObodWeC6TFt7uOeD23b5 PG7crailKJikReEtzETJVD4G4ET/mFzOqlKAeopHLbpTNhV/G5kFxLBsK 5zigC9Ingsbsg/DGxfSPYqaV0lczDuMuEM+CqhL5V90myCR2ZrIinev6C n5w+mvWog2a175WUmAXoyrEOpA4cj8OWcxPFHQ0RZWg/omwBzk7+pSvmX Q==; X-CSE-ConnectionGUID: hyT8hgtBTja4KIaVz5LVUQ== X-CSE-MsgGUID: EqdmJ7YQSYKa7zX+inkvGg== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="33341686" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="33341686" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 09:14:59 -0700 X-CSE-ConnectionGUID: xH5VsMGCT6usrv27Khlitw== X-CSE-MsgGUID: G0ymy9IGS3mu9YsKX3cObw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="61348637" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa010.jf.intel.com with ESMTP; 22 Aug 2024 09:14:58 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1EBB42F2; Thu, 22 Aug 2024 19:14:56 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Turquette , Stephen Boyd Subject: [PATCH v1 2/2] clk: x86: lpss-atom: Use temporary variable for struct device Date: Thu, 22 Aug 2024 19:14:08 +0300 Message-ID: <20240822161452.1780149-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240822161452.1780149-1-andriy.shevchenko@linux.intel.com> References: <20240822161452.1780149-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko --- drivers/clk/x86/clk-lpss-atom.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/x86/clk-lpss-atom.c b/drivers/clk/x86/clk-lpss-atom.c index c70088be72d1..391a7d2e98e4 100644 --- a/drivers/clk/x86/clk-lpss-atom.c +++ b/drivers/clk/x86/clk-lpss-atom.c @@ -16,11 +16,12 @@ static int lpss_atom_clk_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct lpss_clk_data *drvdata; struct clk *clk; u32 rate; - drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); + drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); if (!drvdata) return -ENOMEM; @@ -29,7 +30,7 @@ static int lpss_atom_clk_probe(struct platform_device *pdev) /* LPSS free running clock */ drvdata->name = "lpss_clk"; - clk = clk_register_fixed_rate(&pdev->dev, drvdata->name, NULL, 0, rate); + clk = clk_register_fixed_rate(dev, drvdata->name, NULL, 0, rate); if (IS_ERR(clk)) return PTR_ERR(clk);