Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4271694imm; Mon, 15 Oct 2018 11:52:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV61ZDqV7Xz6CPm++FA0kBaltaTiwU7jPDFq5fH/wqGHUb6QFsaRz85DtbU6P+zCT71hYpdum X-Received: by 2002:a17:902:b584:: with SMTP id a4-v6mr7474832pls.248.1539629545806; Mon, 15 Oct 2018 11:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539629545; cv=none; d=google.com; s=arc-20160816; b=bPtZ8fbwuE+g2r52Q19y1aCvlyPSXxmAHFKXdIWD6prj4+Fh+FZlmnVVHUOCke8APr uHhBq89Gwn5Z/3dOp2DZlU+POd5NUEWRZgf1eji7IEWEb+MCG6HAmqwBVwm13kHuqS8W ss9FYHbVIE6c60zbJ1v92Lj0A7Lo6RRt4RB57P/2jjytBPuyS/xxJvvjLGY0yrQV8pqu BbDalADLiwhv7CEONIkkQDxuO3lQDZz0grMKntBrM166lxb1a2irLwK+PgO7vp9LIXoZ jc/XDz1pvoKBev7tGOIr3/3nPr9YOtVTqvO6PmXvjVTI1x/MrzN+B3HRhbzg3sW0AnDU jGhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DWciO0XBN3UW6fn55r9D0ORvUXjAdv8IMu+2+L7MJCc=; b=kWOJZNqU2DOTzpNAwAOFQeBC1WSeQ0KpqJwRBsSQ7Po1PcUgGyVu0XvNLPZNBLFnFG u3eaLw35DHSLJolfC8SP8dSNxCDgEgCsn47AkLrHdXpftoOmICwwPaPYBK70FEx8g+OM D7Uyi3RnnlgwYNnAOZzglAXPRnP4VGZL52K9qAbHEjedpidPdymk3ss52zIW7O5N/pGP quPi4coLdDo/UKVtw2mOM1hecQAr8PNc4bq3pTh9v7R3uOZGJssv7leuZTH2oCUYHNFp fPPEc1ghVFcFkkP6CN7/gflBAbu3jej3Vnv3nmfPIowNq+aFKJaOIuYytffBzD96EXcL 3T8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AcJoOG4P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h71-v6si4586576pge.174.2018.10.15.11.52.09; Mon, 15 Oct 2018 11:52:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AcJoOG4P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbeJPCh7 (ORCPT + 99 others); Mon, 15 Oct 2018 22:37:59 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45724 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726707AbeJPCh7 (ORCPT ); Mon, 15 Oct 2018 22:37:59 -0400 Received: by mail-pl1-f196.google.com with SMTP id y15-v6so9725805plr.12 for ; Mon, 15 Oct 2018 11:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DWciO0XBN3UW6fn55r9D0ORvUXjAdv8IMu+2+L7MJCc=; b=AcJoOG4PlDVljWnnONd00UzurFoAYE23LtI8MUX3Fs+D9siEzOmuajLIFGksaar5ys sog0gg363LWiPBADrsH089Kusm3iQGVOsCwftLL1symwncmRGK39Wd/g0UkY18bjVqYA CIoZtHM0Xz+zXGD2D+Oo+rMOBKJOxtQXWPCh0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DWciO0XBN3UW6fn55r9D0ORvUXjAdv8IMu+2+L7MJCc=; b=cefyJU8rl0/vUc03JI4gB3jSufO9hjbLf2lCkJiYNJEARYqV0bMMKxwsZ8q4fl9e4R gli8Gw/kgUSjZ8SeHKHtvKJ9cn4mrmj4woYZvOr1y8L1CVtjIufpMmI8t48QhFw1BOOq klBGserGLB32sosKCRlnLTK5Tbb+sm2ABcDhIDS81yPe1CNB80876dfW5NZbLzhDyrEu gnzY1iXOe5VzLOwZre6oYH8hxcRwzNskMjSrZRtHKIQFLLD+IsQz180dMQCKeHWiDQBn s2ZWhtxtgE1zJWrMFx1aG570lXLlz5j389+9FXRn5pRBCUMhxUCXutA/JNtcq8prQCFZ VdOA== X-Gm-Message-State: ABuFfojCtYLiE5z8CdRaTYM27tZEuNSByfOoriygbclH2X9PS6s97yCE HPuxVRY3xK+VPQAFXQ4JMR6SEg== X-Received: by 2002:a17:902:205:: with SMTP id 5-v6mr18318501plc.307.1539629489504; Mon, 15 Oct 2018 11:51:29 -0700 (PDT) Received: from localhost ([2620:15c:202:1:b6af:f85:ed6c:ac6a]) by smtp.gmail.com with ESMTPSA id l10-v6sm15873841pgs.45.2018.10.15.11.51.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 11:51:28 -0700 (PDT) Date: Mon, 15 Oct 2018 11:51:28 -0700 From: Matthias Kaehlcke To: Marcel Holtmann , "Rafael J . Wysocki" , Greg Kroah-Hartman Cc: Sinan Kaya , Balakrishna Godavarthi , Sakari Ailus , Marcin Wojtas , Andy Shevchenko Andy Shevchenko , Johan Hedberg , LKML , Bluez mailing list , Loic Poulain , Brian Norris Subject: Re: [PATCH v4 1/2] Bluetooth: Add device_get_bd_address() Message-ID: <20181015185128.GT22824@google.com> References: <20180927004810.124185-1-mka@chromium.org> <20180927004810.124185-2-mka@chromium.org> <20180927171305.GG22824@google.com> <20181004173338.GL22824@google.com> <9B742DB5-F584-4A47-A04B-4F72EB17519C@holtmann.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9B742DB5-F584-4A47-A04B-4F72EB17519C@holtmann.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 15, 2018 at 08:06:02PM +0200, Marcel Holtmann wrote: > Hi Matthias, > > >>>> void bt_sock_reclassify_lock(struct sock *sk, int proto); > >>>> > >>>> +int device_get_bd_address(struct device *dev, bdaddr_t *bd_addr); > >>> > >>> Maybe change the API name to start with bt_ and get rid of device_? > >> > >> device_ indicates that we get the BD_ADDR for a 'struct device' and > >> not for e.g. a 'struct fwnode_handle'. > >> > >> Anyway with this version of the patch fwnode_get_bd_address() has been > >> scrapped and it might never be introduced again, so I'm open to change > >> the name to bt_ if there is a general preference for it. > > > > Marcel, can you live with this being added to the Bluetooth code base > > instead of property? Also if you'd prefer the function to be named > > bt_get_bd_address() let me know. > > explain to me again why this is useful? The official binding for providing the BD_ADDR through the device tree is the property 'local-bd-address'. device_get_bd_address() provides a common API to retrieve the BD_ADDR instead of requiring BT drivers to use the lower level fwnode_property_read_u8_array(). It also avoids repeating the check for an all zeroes BD_ADDR in multiple drivers. > I am failing to see the benefit if this is not part of the property.h API. My understanding is that the intention of property.h it to provide an API for common property types used by drivers from different subsystems, hence the implementation 'lives' in drivers/base. Obtaining the BD_ADDR is clearly limited to the Bluetooth subsystem, and drivers/base doesn't seem to be the right place for it. It's true, device_get_mac_address() lives in the common property code, but that doesn't necessarily mean it really should be there and we should do the same. I agree with Sakari that the the approach taken by V4L2 (drivers/media/v4l2-core/v4l2-fwnode.c) seems more appropriate. That said I wouldn't raise opposition if the maintainers of drivers/base agreed to add device_get_mac_address() there, however so far several recent authors of property.[ch] have raised objections. Thanks Matthias