Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6479781ybi; Wed, 31 Jul 2019 15:22:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHbLu+XpX1fNUhi+qj6hMCAcgEfDja4zhNPd12NVuGj2h6uvuFlb1SbmP9whq/I2ZoRUvB X-Received: by 2002:a17:90a:1aa4:: with SMTP id p33mr5151061pjp.27.1564611742946; Wed, 31 Jul 2019 15:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564611742; cv=none; d=google.com; s=arc-20160816; b=ooFjDz+zFTqaz/xmdcoaE0g3zVXCn3M3KPN7iO7Vl9LYTIZJbjcLWd1xnjKZHqplBu 603aCZq6lY5sn1xPd7yYHlAQiCHFaqD59mJ0nOOMwLP54ZmgclV+VwDoXnzuQKcxMBBm VA8vX7NF1ngWvpnsGEHqEjgrFbFGUSZEbB6eDa35h/RO+rn4XkZ5vQrU58bddi7/q+O6 dTxO8woLI/uZUIrpyC+JfJAJeY764nbcKKgNuXsI9bJMqdc4lCOVZ6cMkhnBPAY+uJWm 55b6WFqQp6KFEdYkP+ylvlhPYaBv8PpVGeSfKgOsHR2Yd743TgRDBIZitGXrvge3kV5I eExQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=npKcplv7U0UVtwjdXf5dGMVL5/Fn98TIEb9pCuDJcdU=; b=sPBQgNSspxmB6JpKoAuDKiH60QgxkDgkiZJQD6aAfVa+uDAd4vZivXfP3kR6spV9Mf MSb/wl309ABrJs5k82vPYFB/YgMIKg70XIDooUOqPJipFkpSdPP7Qj4/C32D4wcXCRR0 +DEyQ1ILzAReLpxaFJMvLO23MnL/KRSwrVLadap7sMGRuem67VFz6qWwdad5awBpB1s8 eMF4bq269QTo64Q+RPT9jHdjXaBnpHEOyJ48Qz+7uCn25L+0Ht8iijwE1fPGFoWwkrOT u1fU8woBdlL23eEO3z+6zE9qq0frxjFFn005opvuYVunefSRNhkfq8plsTRe+mtEP5Fb e+Rw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s189si32024332pgb.272.2019.07.31.15.22.07; Wed, 31 Jul 2019 15:22:22 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727403AbfGaWSH (ORCPT + 99 others); Wed, 31 Jul 2019 18:18:07 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:51265 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727702AbfGaWR7 (ORCPT ); Wed, 31 Jul 2019 18:17:59 -0400 Received: from 79.184.255.110.ipv4.supernova.orange.pl (79.184.255.110) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.275) id 930e658ccde014c4; Thu, 1 Aug 2019 00:17:57 +0200 From: "Rafael J. Wysocki" To: Stephen Boyd , Tri Vo Cc: gregkh@linuxfoundation.org, viresh.kumar@linaro.org, rafael@kernel.org, hridya@google.com, sspatil@google.com, kaleshsingh@google.com, ravisadineni@chromium.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v6] PM / wakeup: show wakeup sources stats in sysfs Date: Thu, 01 Aug 2019 00:17:57 +0200 Message-ID: <32598586.Mjd66ZhNnG@kreacher> In-Reply-To: <5d420f45.1c69fb81.35877.3d86@mx.google.com> References: <20190731215514.212215-1-trong@android.com> <5d420f45.1c69fb81.35877.3d86@mx.google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, July 31, 2019 11:59:32 PM CEST Stephen Boyd wrote: > Quoting Tri Vo (2019-07-31 14:55:14) > > +/** > > + * wakeup_source_sysfs_add - Add wakeup_source attributes to sysfs. > > + * @parent: Device given wakeup source is associated with (or NULL if virtual). > > + * @ws: Wakeup source to be added in sysfs. > > + */ > > +int wakeup_source_sysfs_add(struct device *parent, struct wakeup_source *ws) > > +{ > > + struct device *dev; > > + int id; > > + > > + id = ida_alloc(&wakeup_ida, GFP_KERNEL); So can anyone remind me why the IDA thing is needed here at all? > > + if (id < 0) > > + return id; > > + ws->id = id; > > + > > + dev = device_create_with_groups(wakeup_class, parent, MKDEV(0, 0), ws, > > + wakeup_source_groups, "ws%d", > > I thought the name was going to still be 'wakeupN'? So can't we prefix the wakeup source name with something like "wakeup:" or similar here?