[PATCH -next v2] phy: realtek: usb: Drop unnecessary error check for debugfs_create_dir()
Greg Kroah-Hartman
gregkh at linuxfoundation.org
Fri Sep 1 01:25:54 PDT 2023
On Fri, Sep 01, 2023 at 03:52:31PM +0800, Jinjie Ruan wrote:
> Both debugfs_create_dir() and debugfs_create_file() return ERR_PTR
> and never return NULL.
>
> As Greg suggested, this patch removes the error checking for
> debugfs_create_dir in phy-rtk-usb2.c and phy-rtk-usb3.c. This is because
> the DebugFS kernel API is developed in a way that the caller can safely
> ignore the errors that occur during the creation of DebugFS nodes. The
> debugfs APIs have a IS_ERR() judge in start_creating() which can handle it
> gracefully. So these checks are unnecessary.
>
> Fixes: 134e6d25f6bd ("phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY")
> Fixes: adda6e82a7de ("phy: realtek: usb: Add driver for the Realtek SoC USB 3.0 PHY")
> Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>
> Suggested-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Reviewed-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
More information about the linux-phy
mailing list