Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752968AbbGNA7O (ORCPT ); Mon, 13 Jul 2015 20:59:14 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46633 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751741AbbGNA7N (ORCPT ); Mon, 13 Jul 2015 20:59:13 -0400 Message-ID: <55A45EDE.6050603@codeaurora.org> Date: Mon, 13 Jul 2015 17:59:10 -0700 From: Stephen Boyd User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Dmitry Torokhov CC: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, Bjorn Andersson Subject: Re: [PATCH v2] Input: pmic8xxx-pwrkey - Support shutdown References: <1436830234-28316-1-git-send-email-sboyd@codeaurora.org> <20150714002504.GC7945@dtor-ws> <55A45931.4010509@codeaurora.org> <20150714004638.GD7945@dtor-ws> <55A45EAA.9040001@codeaurora.org> In-Reply-To: <55A45EAA.9040001@codeaurora.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1683 Lines: 47 On 07/13/2015 05:58 PM, Stephen Boyd wrote: > On 07/13/2015 05:46 PM, Dmitry Torokhov wrote: >> On Mon, Jul 13, 2015 at 05:34:57PM -0700, Stephen Boyd wrote: >>> On 07/13/2015 05:25 PM, Dmitry Torokhov wrote: >>>>> + >>>>> +static const struct of_device_id pm8xxx_pwr_key_id_table[] = { >>>>> + { .compatible = "qcom,pm8058-pwrkey", .data = >>>>> &pm8058_pwrkey_shutdown }, >>>>> + { .compatible = "qcom,pm8921-pwrkey", .data = >>>>> &pm8921_pwrkey_shutdown }, >>>>> + { } >>>>> +}; >>>>> +MODULE_DEVICE_TABLE(of, pm8xxx_pwr_key_id_table); >>>>> + >>>> Can we please keep IDs and device table where it was, close to the >>>> driver definition? >>> That would require forward declaring the array here. Is that >>> desired? I moved it so that I could use it in the probe function. >> Ah, yes, OF data is not passed into probe() :(... But we can always do: >> >> match = of_match_device(pdev->dev.driver->of_match_table, >> &pdev->dev); >> >> Maybe we could have a helper for this like: >> >> const struct of_device_id *of_get_current_match(struct device *dev) >> { >> return dev->drv ? >> of_match_device(dev->driver->of_match_table, dev) : >> NULL; >> } > > Nice. I'll update and Cc the OF maintainers. > Actually, this already exists I just didn't know. See of_device_get_match_data(). -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- 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/