usb: chipidea: don't redefine __ffs()
chipidea's ffs_nr() is pretty much what __ffs() does. Use that one instead. Signed-off-by: Felipe Balbi <balbi@ti.com> [rebased on top of debug infrastructure rework] Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
ba8618e067
commit
727b4ddb48
@@ -234,19 +234,6 @@ enum ci13xxx_regs {
|
||||
OP_LAST = OP_ENDPTCTRL + ENDPT_MAX / 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* ffs_nr: find first (least significant) bit set
|
||||
* @x: the word to search
|
||||
*
|
||||
* This function returns bit number (instead of position)
|
||||
*/
|
||||
static inline int ffs_nr(u32 x)
|
||||
{
|
||||
int n = ffs(x);
|
||||
|
||||
return n ? n-1 : 32;
|
||||
}
|
||||
|
||||
/**
|
||||
* hw_read: reads from a hw register
|
||||
* @reg: register index
|
||||
@@ -305,7 +292,7 @@ static inline u32 hw_test_and_write(struct ci13xxx *ci, enum ci13xxx_regs reg,
|
||||
u32 val = hw_read(ci, reg, ~0);
|
||||
|
||||
hw_write(ci, reg, mask, data);
|
||||
return (val & mask) >> ffs_nr(mask);
|
||||
return (val & mask) >> __ffs(mask);
|
||||
}
|
||||
|
||||
int hw_device_reset(struct ci13xxx *ci, u32 mode);
|
||||
|
Reference in New Issue
Block a user