diff options
author | Vinod Koul <vkoul@kernel.org> | 2020-09-03 17:14:57 +0530 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2020-09-04 14:46:41 +0530 |
commit | d5826a4bdbc88004279df1f24db61e8e48071f78 (patch) | |
tree | c5ce9aa779b32442c9b86b8000bde71e30ed2772 /drivers/soundwire | |
parent | 25e804926da39f1de7ae486920bfe65b099195f1 (diff) | |
download | linux-d5826a4bdbc88004279df1f24db61e8e48071f78.tar.gz linux-d5826a4bdbc88004279df1f24db61e8e48071f78.tar.bz2 linux-d5826a4bdbc88004279df1f24db61e8e48071f78.zip |
soundwire: bus: use FIELD_GET()
use FIELD_GET() in bus code to extract field values instead of open
coding masks and shift operations.
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200903114504.1202143-3-vkoul@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r-- | drivers/soundwire/bus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index e6e0fb9a81b4..d808f0256ba0 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -347,8 +347,8 @@ int sdw_fill_msg(struct sdw_msg *msg, struct sdw_slave *slave, return -EINVAL; } - msg->addr_page1 = (addr >> SDW_REG_SHIFT(SDW_SCP_ADDRPAGE1_MASK)); - msg->addr_page2 = (addr >> SDW_REG_SHIFT(SDW_SCP_ADDRPAGE2_MASK)); + msg->addr_page1 = FIELD_GET(SDW_SCP_ADDRPAGE1_MASK, addr); + msg->addr_page2 = FIELD_GET(SDW_SCP_ADDRPAGE2_MASK, addr); msg->addr |= BIT(15); msg->page = true; @@ -1420,7 +1420,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) port = buf & SDW_SCP_INT1_PORT0_3; /* To get port number corresponding to bits, shift it */ - port = port >> SDW_REG_SHIFT(SDW_SCP_INT1_PORT0_3); + port = FIELD_GET(SDW_SCP_INT1_PORT0_3, port); for_each_set_bit(bit, &port, 8) { sdw_handle_port_interrupt(slave, bit, &port_status[bit]); |