Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2884192pxa; Mon, 17 Aug 2020 23:59:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzg59K+IdCxs0zECJbVeKw8ZXKfnfeLwXjmUPQNVvfbFgKZ95lOSlNBiqn3DjVw9fC831Nd X-Received: by 2002:a17:906:e0d:: with SMTP id l13mr19676767eji.434.1597733984933; Mon, 17 Aug 2020 23:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597733984; cv=none; d=google.com; s=arc-20160816; b=lLClOyE8htUyut3eiR9Ybnlygn4EZVRplCXgbnGW8BL3UiWozbGq1W2+WzA+SNSGXX 4RlkogW9xR8ZNNI0Eik7I88wSzwyLiuMeMefZZYTEJyoy1yOYodTY9HPXRy8uFZaFJz7 Sw+vkhhySy3uJjzPtfjyq6MfLYzRvoZGZFzkE3AIRUgq/ksYC5TwyCGCwjQYfE5ihGIo nMWH/0P9O7+tG/cmqyPQ1iJoMeDdi5Rtv4dbn555g/ZrKdd8vjlm5kyjXIAxVU3BRLty nqfFq9vuwjoiHUAloCN5q+Tmc9woBKSbZicAdDhF/aUOF53nB6nAXsB+Ad73pOUV0IpY u61A== 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:ironport-sdr:ironport-sdr; bh=NSbW1RRZrLGkzXuN3sL6nvxzEB7VoRzZXkIsjm7o4FY=; b=lOKGgqfCgyKN6EmVCQvRbOQTamO9CodFGdURL3PAAEt1+0YzvYu817VWOaY5BPntng UkZ47RmyoCHwjmMYqa1KeRgytxLxZ6y/QMewJUfOGe6+PKW7qjhiB/RTSLiWqMUcMsCX aA0G4eD5MOy+qnAIezsAzQ5i8wKQCBvA+97IEJSQX7FbwA/LmAD/0xr9Z6JwcuTB/OCD OLajvMT3WtOQ+FNS1YKSS0qs81Dqq4cqoQrTBE57jzlUeKl+HBBGQcNds1KExpPUjMOg mJmkqoCEChbTWUp7iefyD+rk6tmi1SpicSGk64YNAV5PgEodPLnbb7rxUTGmpMlWrkBz kNng== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr6si9512353ejb.638.2020.08.17.23.59.21; Mon, 17 Aug 2020 23:59:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbgHRG5v (ORCPT + 99 others); Tue, 18 Aug 2020 02:57:51 -0400 Received: from mga12.intel.com ([192.55.52.136]:12594 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726583AbgHRG5t (ORCPT ); Tue, 18 Aug 2020 02:57:49 -0400 IronPort-SDR: Jl183Dwhe3hr6M3TOsz/EDKFd/lvMOPJLzxxHBf1uQjdYzViwl02ZSkbyEzEE1zXNrnCLvdoO3 Cy+TQP7IDuLQ== X-IronPort-AV: E=McAfee;i="6000,8403,9716"; a="134374120" X-IronPort-AV: E=Sophos;i="5.76,326,1592895600"; d="scan'208";a="134374120" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 23:57:48 -0700 IronPort-SDR: MiFHRhmrpZSXrvaLxwc6oomeeseihVY+7xo/oR8ia5mw0HF3k4H+sWYaNmQdNWhE4PfGdFZ62z XtnC0ntwuocQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,326,1592895600"; d="scan'208";a="370807249" Received: from sgsxdev004.isng.intel.com (HELO localhost) ([10.226.88.13]) by orsmga001.jf.intel.com with ESMTP; 17 Aug 2020 23:57:45 -0700 From: "Ramuthevar,Vadivel MuruganX" To: linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com Cc: andriy.shevchenko@intel.com, thomas.langer@intel.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, yin1.li@intel.com, Ramuthevar Vadivel Murugan Subject: [PATCH v1 5/9] extcon: extcon-ptn5150: Switch to GENMASK() for port attachment macro Date: Tue, 18 Aug 2020 14:57:23 +0800 Message-Id: <20200818065727.50520-6-vadivel.muruganx.ramuthevar@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200818065727.50520-1-vadivel.muruganx.ramuthevar@linux.intel.com> References: <20200818065727.50520-1-vadivel.muruganx.ramuthevar@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ramuthevar Vadivel Murugan Switch to GENMASK() macro for the port attachment. Signed-off-by: Ramuthevar Vadivel Murugan --- drivers/extcon/extcon-ptn5150.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c index 50fff148b772..31b7cbf1551d 100644 --- a/drivers/extcon/extcon-ptn5150.c +++ b/drivers/extcon/extcon-ptn5150.c @@ -38,9 +38,7 @@ enum ptn5150_reg { #define PTN5150_REG_DEVICE_ID_VERSION GENMASK(7, 3) #define PTN5150_REG_DEVICE_ID_VENDOR GENMASK(2, 0) -#define PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT 2 -#define PTN5150_REG_CC_PORT_ATTACHMENT_MASK \ - (0x7 << PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT) +#define PTN5150_REG_CC_PORT_ATTACHMENT GENMASK(4, 2) #define PTN5150_REG_CC_VBUS_DETECTION BIT(7) @@ -108,9 +106,8 @@ static void ptn5150_irq_work(struct work_struct *work) unsigned int port_status; unsigned int vbus; - port_status = ((reg_data & - PTN5150_REG_CC_PORT_ATTACHMENT_MASK) >> - PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT); + port_status = FIELD_GET(PTN5150_REG_CC_PORT_ATTACHMENT, + reg_data); switch (port_status) { case PTN5150_DFP_ATTACHED: -- 2.11.0