Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5923715imd; Wed, 31 Oct 2018 04:20:07 -0700 (PDT) X-Google-Smtp-Source: AJdET5dT2cclVBqrWtWz8huBecJMl27woxi4QBcF+UEAnfxGOXp801z+UBejyQFyvqxDSb2ZAODP X-Received: by 2002:a62:9316:: with SMTP id b22-v6mr3021279pfe.193.1540984807041; Wed, 31 Oct 2018 04:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540984807; cv=none; d=google.com; s=arc-20160816; b=Xm7UoY1EXkJBg11CVlCBpNxFRD+fVKqXWJPQBFv6Nj53l7kY+fIKtAvzGUJjzFyOrq O9eqivFczdGoBJdBZdKH79+oKaHWXB85prQL38H1oa9p7Q4k3h23vRz+JYVLXVUx04DC qJhN1zdaV5Dw8xLHKpjwi0lK95FjT+tmBWPsnXH/RIUlvNytf5PbuSmSpRUEU27DoBxO 42LWIldNdxT4hYV3zhR2toC6igUbcm88eXXlGjX0GeNtqCb9ZPQDxmLiylfefJCHGWoY jRVtiIoKT4yxOtUHFW0z9T2dHWlAaJqfV5MCeGSvpxLYC3utsv7VneKUFR8pUa66Y3IJ mEFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization; bh=gF0G8tvrSYP1ydtpQ6IzisIyvxOdOTfEMDqliWsxf6A=; b=dJd3yGFu/dh8+BR7LfMmc+k1G74n8AMXfdmIpm5GsXFd1XvoT0MRZrjf97XJZDSxx/ 9Wu65wX652eE1Q+8YIfg1IfOfyY8KkAC1/WjkkTgjew2XG4jGB+inV+2gYZbq40j/sDe fubjI+kJPnTvTbN7beuHbXibbS9g2kqdxUkCYFXTFNWH8Qi3+HjpSxA9cqgBwnzX60sO gSWgQq1y7Elp37zRo36Na/Kcpb4dvbkoSr/QNW73D6pVaXLzcLmHNrXoi+kGdfKFpHpK HxUHmtC7qTppAK4N3PZhGSD6+P/aXv46LaybgkpORW6Hxgwgc4eo8XWDLMrIUG3P5nrb VYSQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8-v6si27592048pgo.220.2018.10.31.04.19.51; Wed, 31 Oct 2018 04:20:07 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728384AbeJaURJ convert rfc822-to-8bit (ORCPT + 99 others); Wed, 31 Oct 2018 16:17:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37550 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725831AbeJaURJ (ORCPT ); Wed, 31 Oct 2018 16:17:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A02743082AF3; Wed, 31 Oct 2018 11:19:30 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-113.rdu2.redhat.com [10.10.120.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1CF7A5D6A6; Wed, 31 Oct 2018 11:19:28 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20181031104912.s3tqjl3u43ou3kwo@gofer.mess.org> References: <20181031104912.s3tqjl3u43ou3kwo@gofer.mess.org> <20181030223249.dhwhxdjipzmjxzsy@gofer.mess.org> <153778383104.14867.1567557014782141706.stgit@warthog.procyon.org.uk> <20181030110319.764f33f0@coco.lan> <8474.1540982182@warthog.procyon.org.uk> To: Sean Young Cc: dhowells@redhat.com, Mauro Carvalho Chehab , Michael Krufky , Brad Love , mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dvb: Allow MAC addresses to be mapped to stable device names with udev MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12107.1540984768.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Wed, 31 Oct 2018 11:19:28 +0000 Message-ID: <12108.1540984768@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 31 Oct 2018 11:19:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sean Young wrote: > > > Devices without a mac address shouldn't have a mac_dvb sysfs attribute, > > > I think. > > > > I'm not sure that's possible within the core infrastructure. It's a class > > attribute set when the class is created; I'm not sure it can be overridden on > > a per-device basis. > > > > Possibly the file could return "" or "none" in this case? > > That's very ugly. Have a look at, for example, rc-core wakeup filters: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/rc/rc-main.c#n1844 By analogy, then, I think the thing to do is to put something like struct rc_dev::sysfs_groups[] into struct dvb_device (or maybe struct dvb_adapter) and then the dvb_mac attribute in there during dvb_register_device() based on whether or not the MAC address is not all zeros at that point. David