Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp329927pxj; Thu, 27 May 2021 00:49:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2kby3AyXMRImiPCxg06y89fDNUy9KNFI8sgu/k9erFdwGmoUyyIcab17vnXdEtXDufZSS X-Received: by 2002:a05:6638:134c:: with SMTP id u12mr2252923jad.67.1622101791600; Thu, 27 May 2021 00:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622101791; cv=none; d=google.com; s=arc-20160816; b=shAEpFY3I3pGQ9LglEQ4aYaMWD1vncf9nHCo2dZ2eNPVgDfChX4HFg/cbiujx7123B p6Z5aTXg9DCcqi+i0io0auvp9+uslz2si8O7KVnnHKyylEFngH46PX9lrurus6y6VJEO bVVA2ZzyI0aNs51vZPHE9dpEwB6/p49vyF2eafJb00D2fENvFQO4zgOqP6WSmW4PeiZM YB+6fOhBBkYA8HmlQchUxJTzO7DiDB9OwCgM/WjCpYZ/8zdzwc85bLMqHfkeWZWJsTH0 9V9UdIrvzrbayUEWyva0mS2w2MABxxBbPA+GSw3SukMZAIFnLhgq6MjswwMtWDgXptIa B70A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MSwQSh99oKpv9snbG0KZWgCm4yHpvXRSGo38jkWaVJ8=; b=gEDWXR2P62PcQVv/p9YtLFIlaRbBolTD+ZxjY9y87yUuYCDA5WhV+vsxLR6X3vtTj8 keoUc6gk7002SPsWxp96XFOcu6O8tLh6bkYet764gCnUyCVbJpYVTzzxqjKIbXu8XrKV zDw0hqWG0TutWVwsqC7luympUmYT00QUFlCyeaMQpdq8+uBgLNgHFxuMd0yvOad87Y+X Av/FmmYRHieNPa49Wi6vR0+H6nNlMRKbUuzDtMy32Nd5MCAeDU3J3lA49eBzS8MsfAeJ Xq4WDJp4feOF12TgVPS/LTcg8QG0ohCxHyl37Po94B0qj8zl/08kvEY/jVAOEvt4Jtuq vccA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jV1mzuY7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si1548283iow.25.2021.05.27.00.49.37; Thu, 27 May 2021 00:49:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jV1mzuY7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234974AbhE0HmS (ORCPT + 99 others); Thu, 27 May 2021 03:42:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:40464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234318AbhE0HmR (ORCPT ); Thu, 27 May 2021 03:42:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 36A27610A6; Thu, 27 May 2021 07:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622101243; bh=Irlo7mGbJ+1ThfdROf+4QLN6ktaoyaBx/mf73kvLs4I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jV1mzuY7JTsHFcNoKiKjyj1zAbzNaoUurjWnPVFZ9QxzBTKgbsAkxYfAPq/F3ggwr cpPprcqhwkwTxtlGARNEMfh0T1U9hzr6Wy6RKQOdGYqnNWJjqA9t128hbhvoBUpPX3 SGnCohFgM117oI9CmIe/4hWNs9Nlg1oaTOhnp+98= Date: Thu, 27 May 2021 09:40:40 +0200 From: Greg Kroah-Hartman To: Rajat Jain Cc: "Rafael J. Wysocki" , Bjorn Helgaas , Alan Stern , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, helgaas@kernel.org, Oliver Neukum , David Laight , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , rajatxjain@gmail.com, jsbarnes@google.com, dtor@google.com Subject: Re: [PATCH v5 1/2] driver core: Move the "removable" attribute from USB to core Message-ID: References: <20210524171812.18095-1-rajatja@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210524171812.18095-1-rajatja@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 10:18:11AM -0700, Rajat Jain wrote: > Move the "removable" attribute from USB to core in order to allow it to be > supported by other subsystem / buses. Individual buses that want to support > this attribute can populate the removable property of the device while > enumerating it with the 3 possible values - > - "unknown" > - "fixed" > - "removable" > Leaving the field unchanged (i.e. "not supported") would mean that the > attribute would not show up in sysfs for that device. The UAPI (location, > symantics etc) for the attribute remains unchanged. > > Move the "removable" attribute from USB to the device core so it can be > used by other subsystems / buses. > > By default, devices do not have a "removable" attribute in sysfs. > > If a subsystem or bus driver wants to support a "removable" attribute, it > should call device_set_removable() before calling device_register() or > device_add(), e.g.: > > device_set_removable(dev, DEVICE_REMOVABLE); > device_register(dev); > > The possible values and the resulting sysfs attribute contents are: > > DEVICE_REMOVABLE_UNKNOWN -> "unknown" > DEVICE_REMOVABLE -> "removable" > DEVICE_FIXED -> "fixed" > > Convert the USB "removable" attribute to use this new device core > functionality. There should be no user-visible change in the location or > semantics of attribute for USB devices. > > Signed-off-by: Rajat Jain > Reviewed-by: Bjorn Helgaas > --- > v5: - Update commit log per Bjorn's suggestion, and add "Reviewed by". > - don't check for dev!=NULL I've applied this series to my USB tree now, thanks for reworking it so many times. greg k-h