mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
8250-men-mcb: fix signed/unsigned confusion
get_num_ports returns -ENODEV, and the result is stored in int, so it should not be unsigned. Zero ports does not seem to make sense, so make that check consistent. Signed-off-by: Pavel Machek (CIP) <pavel@denx.de> Link: https://lore.kernel.org/r/20200606151146.GA10940@amd Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
167cbce274
commit
894b867ac9
1 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@ static u32 men_lookup_uartclk(struct mcb_device *mdev)
|
||||||
return clkval;
|
return clkval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int get_num_ports(struct mcb_device *mdev,
|
static int get_num_ports(struct mcb_device *mdev,
|
||||||
void __iomem *membase)
|
void __iomem *membase)
|
||||||
{
|
{
|
||||||
switch (mdev->id) {
|
switch (mdev->id) {
|
||||||
|
@ -140,7 +140,7 @@ static void serial_8250_men_mcb_remove(struct mcb_device *mdev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
num_ports = get_num_ports(mdev, data[0].uart.port.membase);
|
num_ports = get_num_ports(mdev, data[0].uart.port.membase);
|
||||||
if (num_ports < 0 || num_ports > 4) {
|
if (num_ports <= 0 || num_ports > 4) {
|
||||||
dev_err(&mdev->dev, "error retrieving number of ports!\n");
|
dev_err(&mdev->dev, "error retrieving number of ports!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue