From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 522681867 for ; Wed, 20 Apr 2022 17:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650477427; x=1682013427; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=NEh9iB5JfPPqjjEsQjcgin93qCXOmz1GRjuBdLqZtTo=; b=UPDtlvGd15flw6G8Xp09IO8HzoRZP322IfO3vCNVGyLf4KFzyPSGu38i SnEzJ3s6Po+rjvNimF/ZfxGC+TpQN+KfiS62qTJK+IsXWx0pxOMResv5i akdbFL3IxikDnwvU+Ax0ipfQMImZpLrDbiqoGKSBSIlxBmqj7XKzoLpYk F1Izp4BA7k05HI2gRTBouQnSckIXLX1RMTdGGOkFe7edPknU9/1bgR/sO GPYrUCoItIJgDBnTXp6TMd81FrQCepQVkhkGL5rtwZAuEIqpEn42zSRTS BboTekdvhIJsqcg6XmCj7agg11OGZFMjIBQ09m+cdrE0D5Xm7pDS/TbET g==; X-IronPort-AV: E=McAfee;i="6400,9594,10323"; a="324552008" X-IronPort-AV: E=Sophos;i="5.90,276,1643702400"; d="scan'208";a="324552008" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 10:57:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,276,1643702400"; d="scan'208";a="555324482" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga007.jf.intel.com with ESMTP; 20 Apr 2022 10:57:05 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 20 Apr 2022 10:57:05 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 20 Apr 2022 10:57:04 -0700 Received: from fmsmsx610.amr.corp.intel.com ([10.18.126.90]) by fmsmsx610.amr.corp.intel.com ([10.18.126.90]) with mapi id 15.01.2308.027; Wed, 20 Apr 2022 10:57:04 -0700 From: "Luck, Tony" To: Greg KH CC: "Williams, Dan J" , Hans de Goede , "markgross@kernel.org" , "Thomas Gleixner" , Ingo Molnar , "Borislav Petkov" , Dave Hansen , X86 ML , "H. Peter Anvin" , Jonathan Corbet , Andy Shevchenko , "Joseph, Jithu" , "Raj, Ashok" , Steven Rostedt , Linux Kernel Mailing List , Linux Doc Mailing List , "platform-driver-x86@vger.kernel.org" , "patches@lists.linux.dev" , "Shankar, Ravi V" Subject: RE: [PATCH v3 03/11] platform/x86/intel/ifs: Create device for Intel IFS (In Field Scan) Thread-Topic: [PATCH v3 03/11] platform/x86/intel/ifs: Create device for Intel IFS (In Field Scan) Thread-Index: AQHYVAv92LA3gQ6+7UWRqBVIgiQr06z355WAgAAWzYCAAOUNAIAACuQAgACb+YD//4u7sA== Date: Wed, 20 Apr 2022 17:57:04 +0000 Message-ID: <578be5d8874f4942a58adf5f64c4e817@intel.com> References: <20220407191347.9681-1-jithu.joseph@intel.com> <20220419163859.2228874-1-tony.luck@intel.com> <20220419163859.2228874-4-tony.luck@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 x-originating-ip: [10.1.200.100] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 >> ifs_class =3D class_create(THIS_MODULE, "intel_ifs"); > > Why do you need a class? Why not just use a misc device? Saves you > loads of boilerplate code that is sometimes tricky to get correct. It didn't feel like a "ton" of boiler plate. Just class_create()/class_dest= roy() for the class itself. And class_for_each_device(ifs_class, NULL, NULL, ifs_device_unregister); to clean up devices on exit (or error cleanup in init()). I thought I needed a class to make a directory for my per-test directories = to live in: $ ls -l /sys/devices/virtual/intel_ifs total 0 drwxr-xr-x 3 root root 0 Apr 20 13:36 ifs0 drwxr-xr-x 3 root root 0 Apr 20 13:36 ifs1 Can I do that with a misc device? Or is it ok for them all to sit at the top level of /sys/devices/virtual? -Tony