Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752326Ab3JJEc6 (ORCPT ); Thu, 10 Oct 2013 00:32:58 -0400 Received: from mga01.intel.com ([192.55.52.88]:41225 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318Ab3JJEc4 (ORCPT ); Thu, 10 Oct 2013 00:32:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,1068,1371106800"; d="scan'208";a="408643561" From: Jani Nikula To: Aaron Lu , "Rafael J. Wysocki" Cc: linux-acpi@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Daniel Vetter , Matthew Garrett , Seth Forshee , Lee Chun-Yi , Richard Purdie , Igor Gnatenko , Yves-Alexis Perez , Felipe Contreras , Ben Jencks , Steven Newbury , James Hogan , Kamal Mostafa , Joerg Platte , Kalle Valo , Martin Steigerwald , =?utf-8?Q?J=C3=B6rg?= Otte , Mike Galbraith , platform-driver-x86@vger.kernel.org, Mika Westerberg , Henrique de Moraes Holschuh Subject: Re: [PATCH v4 1/4] backlight: introduce backlight_device_registered In-Reply-To: <5255FAC5.2090105@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <1381214401-24672-1-git-send-email-aaron.lu@intel.com> <1381214401-24672-2-git-send-email-aaron.lu@intel.com> <2202423.8QyNjoNEPr@vostro.rjw.lan> <5255FAC5.2090105@intel.com> User-Agent: Notmuch/0.16+88~gce1bf71 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Thu, 10 Oct 2013 07:29:53 +0300 Message-ID: <878uy1694u.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1390 Lines: 41 On Thu, 10 Oct 2013, Aaron Lu wrote: > On 10/10/2013 08:25 AM, Rafael J. Wysocki wrote: >> On Tuesday, October 08, 2013 02:39:58 PM Aaron Lu wrote: >>> +bool backlight_device_registered(enum backlight_type type) >>> +{ >>> + bool found = false; >>> + struct backlight_device *bd; >>> + >>> + mutex_lock(&bd_list_mutex); >>> + list_for_each_entry(bd, &bd_list_head, entry) { >>> + if (bd->props.type == type) { >>> + found = true; >>> + break; >>> + } >>> + } >> >> Isn't it useful to be able to register more than one backlight device of the >> same type sometimes? > > I think so for some kind of computers. OTOH, the above function should > be enough for the problem we are solving here, if someday we need to > differentiate, we can enhance the code then. Since both Baytrail and Haswell already have two backlight PWMs, this may be needed sooner than you think. But we shouldn't let that block fixing the more urgent issue we have now. So I'm fine with this. It doesn't prevent one from registering more than one device of the same type anyway. BR, Jani. -- Jani Nikula, Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/