Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4570805ybe; Mon, 16 Sep 2019 14:40:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyst9Yfgf5MBAi/oPXBAxTojCSLtAdosPx2gLw7x6MUak+a0U6VZZm14UJgJvyQcFaClwOz X-Received: by 2002:a05:6402:14da:: with SMTP id f26mr1438998edx.165.1568670017949; Mon, 16 Sep 2019 14:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568670017; cv=none; d=google.com; s=arc-20160816; b=FlznJLA5cKkYoFqLpNnbZv0nUKGgLU41tIHmgtYhVhtwMVm3Mf0hIc+nOlowNXCi4r FN5P2cmspyF594Nnf8idak4GrYSgN/tdPjIDQ5Vk59VBY5P8gbtDrHa+wNnnCC5cn05L RSosE6qZML1NgMS0SjCxTXL5Rx2mKeNrWLSCZphsJKUWKIH2ukX24kd+y8veagQnCPd1 nAEVhGo4NfalPN5XqOfay9dS1FQ2G5ePj6YXmdOR3N5DUZtVc2A++zASsNyvTYrPupOU nItV0dU2OYCALBQEv2dDsA9o+LIL3xHpaw2hYihbwzo3pYjezruK88fPYdx5JIztJsu5 UOIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=/uh3XzfLPxRlyD2osjtAPeq1YBIIpL6KBUPfwdUYWTk=; b=erWKBytGSXHwQS6B3C+kdAh7xcECgMa5Ztjf2svhJPDIKsBBBB/ULo2uADm3dalXQg T/SadCNAidPV52kYshaByMCiEE8dz//6AS1y2m2kOkvPRMys9guSwRxhdLBR8XFw/IUM b8Jflres7c3yOk6GgEgmkk7fPteUcB2V/XA1qnRK+LjfkSNVDdCqWpknRfIolsXEye5S uFW3NDiqQusvMOZJ/Z59FA9t8K2yUGRsMIoDUn1f4YqEaMJ5NaVbpkcqQGphG8fXSBS6 iNoVOVSfb8tRAdETeFGI2CJEsWsnZNgsliJDMfQlwGThhx50HJm2ZebwoykVoYtNkFJy 0/eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=r7UlKu52; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m20si175950eds.363.2019.09.16.14.39.54; Mon, 16 Sep 2019 14:40:17 -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=@ti.com header.s=ti-com-17Q1 header.b=r7UlKu52; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390485AbfIPSdR (ORCPT + 99 others); Mon, 16 Sep 2019 14:33:17 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:45530 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730086AbfIPSdR (ORCPT ); Mon, 16 Sep 2019 14:33:17 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x8GIXBT2024285; Mon, 16 Sep 2019 13:33:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1568658791; bh=/uh3XzfLPxRlyD2osjtAPeq1YBIIpL6KBUPfwdUYWTk=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=r7UlKu5213zI2y0xhxFiHA4LGMcV4yLLYVnrEQK3x2a5xV4dS6fnvbUr7uFAkeVgv VVYxVnstDMTYooaLq2IU/k+TVtAFsJSi0bRkqy+C8EeNHOJ0XVHPkMr4z8AeAGlLHp LJBl6i4MkqvQcP90SOQvswVKuvRm5aD4I+s0QDeE= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x8GIXBkg048005 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 16 Sep 2019 13:33:11 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 16 Sep 2019 13:33:09 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 16 Sep 2019 13:33:09 -0500 Received: from [10.250.65.13] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8GIXB5F082601; Mon, 16 Sep 2019 13:33:11 -0500 Subject: Re: [PATCH v5 6/9] leds: multicolor: Introduce a multicolor class definition To: Jacek Anaszewski , CC: , , References: <20190911180115.21035-1-dmurphy@ti.com> <20190911180115.21035-7-dmurphy@ti.com> <2bfd27cf-6703-48b8-be82-9b36066ef2ed@gmail.com> From: Dan Murphy Message-ID: Date: Mon, 16 Sep 2019 13:34:53 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <2bfd27cf-6703-48b8-be82-9b36066ef2ed@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jacek On 9/15/19 11:20 AM, Jacek Anaszewski wrote: > >> + >> +static int led_multicolor_init_color(struct led_classdev_mc_data *data, >> + struct led_classdev_mc *mcled_cdev, >> + int color_id, int color_index) >> +{ >> + struct led_classdev *led_cdev = mcled_cdev->led_cdev; >> + struct led_classdev_mc_priv *mc_priv; >> + int ret; >> + >> + mc_priv = devm_kzalloc(led_cdev->dev, sizeof(*mc_priv), GFP_KERNEL); >> + if (!mc_priv) >> + return -ENOMEM; >> + >> + mc_priv->led_color_id = color_id; >> + mc_priv->mcled_cdev = mcled_cdev; >> + >> + data->led_kobj = kobject_create_and_add(led_colors[color_id], >> + data->color_kobj); > No change here since previous version? What prevents you from following > what has been done for drivers/usb/core/ledtrig-usbport.c? > > Use sysfs_create_group() for creating color dir > and sysfs_add_file_to_group() for adding files to it. We have nested directories here.  colors is a directory and then the LED color is a directory. So I am not sure how to create a group under another group without the colors directory kobj. Wondering if you know of any examples? Dan