2020-04-16 00:09:10

by Tang Bin

[permalink] [raw]
Subject: [PATCH] i2c: drivers: Avoid unnecessary check in efm32_i2c_probe()

The function efm32_i2c_probe() is only called with an
openfirmware platform device.Therefore there is no need
to check that it has an openfirmware node.

Signed-off-by: Tang Bin <[email protected]>
Signed-off-by: Shengju Zhang <[email protected]>
---
drivers/i2c/busses/i2c-efm32.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-efm32.c b/drivers/i2c/busses/i2c-efm32.c
index 4de31fae7..4786ef6b2 100644
--- a/drivers/i2c/busses/i2c-efm32.c
+++ b/drivers/i2c/busses/i2c-efm32.c
@@ -312,9 +312,6 @@ static int efm32_i2c_probe(struct platform_device *pdev)
int ret;
u32 clkdiv;

- if (!np)
- return -EINVAL;
-
ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
if (!ddata)
return -ENOMEM;
--
2.20.1.windows.1




2020-05-22 15:11:55

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] i2c: drivers: Avoid unnecessary check in efm32_i2c_probe()

On Wed, Apr 15, 2020 at 10:06:40PM +0800, Tang Bin wrote:
> The function efm32_i2c_probe() is only called with an
> openfirmware platform device.Therefore there is no need
> to check that it has an openfirmware node.
>
> Signed-off-by: Tang Bin <[email protected]>
> Signed-off-by: Shengju Zhang <[email protected]>

Applied to for-next, thanks! I agree the driver will need additions for
non-DT platforms anyhow, so greeting with an OOPS is kinda suitable, too
;)


Attachments:
(No filename) (506.00 B)
signature.asc (849.00 B)
Download all attachments