lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2q+TkZJOfXFYlBO@lunn.ch>
Date:   Tue, 8 Nov 2022 21:38:38 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     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

> +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().

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ