Skip to content

Commit

Permalink
iomap: remove unnecessary comparison
Browse files Browse the repository at this point in the history
PD#152908: driver defect clean up

torvalds#364
torvalds#365
torvalds#366

Change-Id: I53c4bd4cbe1cc82408ec3f0b30b3b8e696ea1fc2
Signed-off-by: Jiamin Ma <[email protected]>
  • Loading branch information
Jiamin Ma authored and akiernan committed Nov 4, 2022
1 parent 24fe21a commit 7ece2e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/amlogic/iomap/iomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void __iomem *meson_reg_map[IO_BUS_MAX];

int aml_reg_read(u32 bus_type, unsigned int reg, unsigned int *val)
{
if ((bus_type >= IO_CBUS_BASE) && (bus_type < IO_BUS_MAX)) {
if (bus_type < IO_BUS_MAX) {
*val = readl((meson_reg_map[bus_type]+reg));
return 0;
} else
Expand All @@ -51,7 +51,7 @@ EXPORT_SYMBOL(aml_reg_read);

int aml_reg_write(u32 bus_type, unsigned int reg, unsigned int val)
{
if ((bus_type >= IO_CBUS_BASE) && (bus_type < IO_BUS_MAX)) {
if (bus_type < IO_BUS_MAX) {
writel(val, (meson_reg_map[bus_type]+reg));
return 0;
} else
Expand All @@ -63,7 +63,7 @@ int aml_regmap_update_bits(u32 bus_type,
unsigned int reg, unsigned int mask,
unsigned int val)
{
if ((bus_type >= IO_CBUS_BASE) && (bus_type < IO_BUS_MAX)) {
if (bus_type < IO_BUS_MAX) {
unsigned int tmp, orig;

aml_reg_read(bus_type, reg, &orig);
Expand Down

0 comments on commit 7ece2e4

Please sign in to comment.