From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 225D3C49ED7 for ; Mon, 16 Sep 2019 18:33:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E93F8206C2 for ; Mon, 16 Sep 2019 18:33:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="r7UlKu52" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728985AbfIPSdR (ORCPT ); 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-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@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