[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a8fe49f4-09f2-2507-e652-cbbb13ed8006@linaro.org>
Date: Tue, 8 Nov 2022 21:58:07 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Andrew Lunn <andrew@...n.ch>,
Dominique Martinet <dominique.martinet@...ark-techno.com>
Cc: Marcel Holtmann <marcel@...tmann.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>,
Johan Hedberg <johan.hedberg@...il.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-bluetooth@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>, mizo@...ark-techno.com
Subject: Re: [RFC PATCH 2/2] bluetooth/hci_h4: add serdev support
On 08/11/2022 21:38, Andrew Lunn wrote:
>> +static int h4_probe(struct serdev_device *serdev)
>> +{
>> + struct h4_device *h4dev;
>> + struct hci_uart *hu;
>> + int ret;
>> + u32 speed;
>> +
>> + h4dev = devm_kzalloc(&serdev->dev, sizeof(*h4dev), GFP_KERNEL);
>> + if (!h4dev)
>> + return -ENOMEM;
>> +
>> + hu = &h4dev->hu;
>> +
>> + hu->serdev = serdev;
>> + ret = device_property_read_u32(&serdev->dev, "max-speed", &speed);
>> + if (!ret) {
>> + /* h4 does not have any baudrate handling:
>> + * user oper speed from the start
>> + */
>> + hu->init_speed = speed;
>> + hu->oper_speed = speed;
>> + }
>> +
>> + serdev_device_set_drvdata(serdev, h4dev);
>> + dev_info(&serdev->dev, "h4 device registered.\n");
>
> It is considered bad practice to spam the logs like this. dev_dbg().
>
>> +
>> + return hci_uart_register_device(hu, &h4p);
>> +}
>> +
>> +static void h4_remove(struct serdev_device *serdev)
>> +{
>> + struct h4_device *h4dev = serdev_device_get_drvdata(serdev);
>> +
>> + dev_info(&serdev->dev, "h4 device unregistered.\n");
>
> dev_dbg().
I would say none of them (the same in probe). Any prints in probe/remove
paths are considered redundant, as core already gives that information.
Best regards,
Krzysztof
Powered by blists - more mailing lists