Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1265785ybg; Thu, 4 Jun 2020 05:34:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVXPMcYUGPGoDwNGnCcXv4nHKux/3hYuOXepWkzWtbeaRutnw2WhnSMQEAkhHWqDNQi43t X-Received: by 2002:a17:906:1c8e:: with SMTP id g14mr3672599ejh.136.1591274059433; Thu, 04 Jun 2020 05:34:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591274059; cv=none; d=google.com; s=arc-20160816; b=gTVF0G7nz85T/YkoVsuQcGpZ8tmUUffN6GBuH9bDWD/Gfy5YKcWrqkO18J/JelK5k2 4cG2KkEixadmYxmM8ajji/A80Fj6zi1s4lQjGyzJ1kltsdvYp8zVZOXxED5J+UcbZfJQ /THZtCJjEAaZX1FNdVxRLF3mzJ8EH53jPQl0Soov4nfMf7R9tjVJJBxAdOnaTovnpVQm HOR90eV5+kQWXuhPeCfnOkL2kj52GocC6t7jSfmOWT0UmQhv512+ri7QTcd/IzMCz+Kj X+XfAp/ZWAj57/+i2nCDYFVW2dBao89eqO6zrFKsc3ifApjIX1Flv383THCdyU6A93qD YBdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=VNvL6qj9PpdUoXieIESpwDHwBx71xWimJ6Ek1i5K4xM=; b=V2z6Js3dko+x/5LRy3o0vhp6EGNpXBcKEnuONtZ7LHdd24Tg7fqoilH/6hhsQtNpUL lJvWT8I9bms125rIETfmXK0usxUatSiLlKN76vEynAa+aLXXaM3IqTYktthh3q5LeVcH pFAMCVJ4TYnM9caZ2h5Z+5wRLTX3Fb6b30JqnDiO0d9Yy5cfI7flg3CALKwMZNIz4Pr/ c1jZjhQ8HxkR16m+CSlaRO5ziFbG8+JWwe5ndKsoEMJs7DBtCgByAi/2uOYrrNeLGd4E 3aj5l40y5qFVoHu/cXzntLMHefpDtFHy2sVA7j/l9XBtGSQvn2vvs0qL1Yu6XfE2bM5K 875A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HuRXwz68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t13si1496279ejr.37.2020.06.04.05.33.56; Thu, 04 Jun 2020 05:34:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HuRXwz68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728090AbgFDLzj (ORCPT + 99 others); Thu, 4 Jun 2020 07:55:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbgFDLzi (ORCPT ); Thu, 4 Jun 2020 07:55:38 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31C34C03E96D; Thu, 4 Jun 2020 04:55:38 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id e12so4474254eds.2; Thu, 04 Jun 2020 04:55:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=VNvL6qj9PpdUoXieIESpwDHwBx71xWimJ6Ek1i5K4xM=; b=HuRXwz68OAb6bq4Slobbg0rrqLp3WpPcRZfw0HnIhej++01bcIwbMVr/rRx9IRq1wI TXgd++T1n9NHCV4rosQhMNFk0H2lMBk3BcFlxzY2QIk7R1BdD7ItNuA+rd3tQyA7eHlm VzHZEroVYFve9vfhLva0NFm8VYl5V0KHWH115tUi+1r1QPJmeF52Fcybl8DPEsiyZYiu n0U05yEFktqlkIi1yVsoh/XFGJAeHVo3YTlZm/UQRKr+eNrozw/XFtweCeXY6YoIxHFA rBTMknMho/7zd0cER/BvF0NZ2Lmrx8zdA5YOGw73qO7t4oIxj9LUGq2cd+2DzWf5OwHA f2YQ== 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; bh=VNvL6qj9PpdUoXieIESpwDHwBx71xWimJ6Ek1i5K4xM=; b=dFvF3aeJk3docJnETfSaXdcgaQwe/2FQXidMKsvuy9cWs+MRUkMtXUlTPQPh8BOp5H H4l1sQwRTA3Ak5TvpbMLpJEVFSgz/q72RxqKDKb73+sk6DwaBLqke1s6LvzoXWptWeYn TCOBh12z2hb2E37cMBhdUm/UHSXF5aUmw39Tr6AT5LkdBVWSNZ/O5Q3QuCZ9H+jCayCL 5l3A+8C4uDEnpuhK5vH2eYpIpUT11BN3s4xIZShdYBnhgf7NFinlCjmSOeumCaA0ELEV 2a6Vs3DX9MEPnsNq98Gl/sLKdtGUaBZrDvaBEHzweeGBNTsQgJGr0T0RACjIbpo9stJZ zkAw== X-Gm-Message-State: AOAM531VMN9N1rPhPPdQ+lRAUdy6V4uZqxRNtucbkn0cvuFQgGwnzWHC Nb2S76D9b4lQszP60QiP4ITgzBuDPAB6ZA== X-Received: by 2002:a50:e08c:: with SMTP id f12mr3902261edl.233.1591271736777; Thu, 04 Jun 2020 04:55:36 -0700 (PDT) Received: from ubuntu-laptop.micron.com ([165.225.203.62]) by smtp.gmail.com with ESMTPSA id m23sm2205709edr.86.2020.06.04.04.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 04:55:36 -0700 (PDT) From: Bean Huo To: alim.akhtar@samsung.com, avri.altman@wdc.com, asutoshd@codeaurora.org, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] scsi: ufs: Add SPDX GPL-2.0 to replace GPL v2 boilerplate Date: Thu, 4 Jun 2020 13:55:35 +0200 Message-Id: <20200604115535.16334-1-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo Add SPDX GPL-2.0 to replace GPL v2 boilerplate, and remove wrapper function ufshcd_setup_clocks() Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd-pltfrm.c | 26 +------------- drivers/scsi/ufs/ufshcd.c | 62 +++++++------------------------- drivers/scsi/ufs/ufshcd.h | 27 +------------- 3 files changed, 15 insertions(+), 100 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c index 76f9be71c31b..8b76a2acc80c 100644 --- a/drivers/scsi/ufs/ufshcd-pltfrm.c +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c @@ -1,36 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Universal Flash Storage Host controller Platform bus based glue driver - * * This code is based on drivers/scsi/ufs/ufshcd-pltfrm.c * Copyright (C) 2011-2013 Samsung India Software Operations * * Authors: * Santosh Yaraganavi * Vinayak Holikatti - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * See the COPYING file in the top-level directory or visit - * - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * This program is provided "AS IS" and "WITH ALL FAULTS" and - * without warranty of any kind. You are solely responsible for - * determining the appropriateness of using and distributing - * the program and assume all risks associated with your exercise - * of rights with respect to the program, including but not limited - * to infringement of third party rights, the risks and costs of - * program errors, damage to or loss of data, programs or equipment, - * and unavailability or interruption of operations. Under no - * circumstances will the contributor of this Program be liable for - * any damages of any kind arising from your use or distribution of - * this program. */ #include diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index f283b9eb97ac..e5ec68fc9fc7 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -1,40 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Universal Flash Storage Host controller driver Core - * - * This code is based on drivers/scsi/ufs/ufshcd.c * Copyright (C) 2011-2013 Samsung India Software Operations * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. * * Authors: * Santosh Yaraganavi * Vinayak Holikatti - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * See the COPYING file in the top-level directory or visit - * - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * This program is provided "AS IS" and "WITH ALL FAULTS" and - * without warranty of any kind. You are solely responsible for - * determining the appropriateness of using and distributing - * the program and assume all risks associated with your exercise - * of rights with respect to the program, including but not limited - * to infringement of third party rights, the risks and costs of - * program errors, damage to or loss of data, programs or equipment, - * and unavailability or interruption of operations. Under no - * circumstances will the contributor of this Program be liable for - * any damages of any kind arising from your use or distribution of - * this program. - * - * The Linux Foundation chooses to take subject only to the GPLv2 - * license terms, and distributes only under these terms. */ #include @@ -243,9 +215,7 @@ static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd); static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag); static void ufshcd_hba_exit(struct ufs_hba *hba); static int ufshcd_probe_hba(struct ufs_hba *hba, bool async); -static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on, - bool skip_ref_clk); -static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on); +static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on, bool skip_ref_clk); static int ufshcd_uic_hibern8_enter(struct ufs_hba *hba); static inline void ufshcd_add_delay_before_dme_cmd(struct ufs_hba *hba); static int ufshcd_host_reset_and_restore(struct ufs_hba *hba); @@ -1525,7 +1495,7 @@ static void ufshcd_ungate_work(struct work_struct *work) } spin_unlock_irqrestore(hba->host->host_lock, flags); - ufshcd_setup_clocks(hba, true); + ufshcd_setup_clocks(hba, true, false); ufshcd_enable_irq(hba); @@ -1683,10 +1653,10 @@ static void ufshcd_gate_work(struct work_struct *work) ufshcd_disable_irq(hba); if (!ufshcd_is_link_active(hba)) - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); else /* If link is active, device ref_clk can't be switched off */ - __ufshcd_setup_clocks(hba, false, true); + ufshcd_setup_clocks(hba, false, true); /* * In case you are here to cancel this work the gating state @@ -7600,8 +7570,7 @@ static int ufshcd_init_hba_vreg(struct ufs_hba *hba) return 0; } -static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on, - bool skip_ref_clk) +static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on, bool skip_ref_clk) { int ret = 0; struct ufs_clk_info *clki; @@ -7664,11 +7633,6 @@ static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on, return ret; } -static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on) -{ - return __ufshcd_setup_clocks(hba, on, false); -} - static int ufshcd_init_clocks(struct ufs_hba *hba) { int ret = 0; @@ -7775,7 +7739,7 @@ static int ufshcd_hba_init(struct ufs_hba *hba) if (err) goto out_disable_hba_vreg; - err = ufshcd_setup_clocks(hba, true); + err = ufshcd_setup_clocks(hba, true, false); if (err) goto out_disable_hba_vreg; @@ -7797,7 +7761,7 @@ static int ufshcd_hba_init(struct ufs_hba *hba) out_disable_vreg: ufshcd_setup_vreg(hba, false); out_disable_clks: - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); out_disable_hba_vreg: ufshcd_setup_hba_vreg(hba, false); out: @@ -7813,7 +7777,7 @@ static void ufshcd_hba_exit(struct ufs_hba *hba) if (ufshcd_is_clkscaling_supported(hba)) if (hba->devfreq) ufshcd_suspend_clkscaling(hba); - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); ufshcd_setup_hba_vreg(hba, false); hba->is_powered = false; ufs_put_device_desc(hba); @@ -8176,10 +8140,10 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) ufshcd_disable_irq(hba); if (!ufshcd_is_link_active(hba)) - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); else /* If link is active, device ref_clk can't be switched off */ - __ufshcd_setup_clocks(hba, false, true); + ufshcd_setup_clocks(hba, false, true); hba->clk_gating.state = CLKS_OFF; trace_ufshcd_clk_gating(dev_name(hba->dev), hba->clk_gating.state); @@ -8238,7 +8202,7 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) ufshcd_hba_vreg_set_hpm(hba); /* Make sure clocks are enabled before accessing controller */ - ret = ufshcd_setup_clocks(hba, true); + ret = ufshcd_setup_clocks(hba, true, false); if (ret) goto out; @@ -8321,7 +8285,7 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) ufshcd_disable_irq(hba); if (hba->clk_scaling.is_allowed) ufshcd_suspend_clkscaling(hba); - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); out: hba->pm_op_in_progress = 0; if (ret) diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 2b62869fa459..ee14fb997803 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -1,37 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Universal Flash Storage Host controller driver - * - * This code is based on drivers/scsi/ufs/ufshcd.h * Copyright (C) 2011-2013 Samsung India Software Operations * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. * * Authors: * Santosh Yaraganavi * Vinayak Holikatti - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * See the COPYING file in the top-level directory or visit - * - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * This program is provided "AS IS" and "WITH ALL FAULTS" and - * without warranty of any kind. You are solely responsible for - * determining the appropriateness of using and distributing - * the program and assume all risks associated with your exercise - * of rights with respect to the program, including but not limited - * to infringement of third party rights, the risks and costs of - * program errors, damage to or loss of data, programs or equipment, - * and unavailability or interruption of operations. Under no - * circumstances will the contributor of this Program be liable for - * any damages of any kind arising from your use or distribution of - * this program. */ #ifndef _UFSHCD_H -- 2.17.1