From patchwork Thu Jan 22 08:47:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 43491 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C2F7F218DB for ; Thu, 22 Jan 2015 08:47:27 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id f15sf246819lbj.2 for ; Thu, 22 Jan 2015 00:47:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=HtNNVHVOYNYZtn7STB2RNZxqf1Z/z+zn6huGmmH2/JI=; b=A30GP//sc9xH8u0fkQk9RBuXGXITDLry/+k4ELUc+yc1TcMpKht9mHHDsMMs+do9Fv PSdyywHjX7UfJ5S4CCVBnVJRoRUeSxCsoUZQgiAx4WqV8wu+G0+0pCE9MeoxGGUwDtXf EZ2xYU3TKxJmZB4umwW3cMsJmVrI+v6CEWeXGgPHWqeEgMIrTg+KQLGIhsldc2mrPWdz EBOh738EXuP6t5KTZqY5NPqZD1m6QPhCo6BEELBtdThSlCUYJNg2jNtAeEC74zeKm+aX 1ZXKZTi9gGeZlR7TFHiVAVERoUKX32DIyiVAA7G2tcl/egBrsIWXZwUSx8k9w6vTsqiS +atw== X-Gm-Message-State: ALoCoQkZ3lemt7aKilyDt5ytnOcsSp1k8I73bUiD/pf5B+g5/F240n0CkN6eZfWuqKwmwbs/1NyS X-Received: by 10.152.43.50 with SMTP id t18mr50780lal.3.1421916446769; Thu, 22 Jan 2015 00:47:26 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.115 with SMTP id q19ls130667laa.55.gmail; Thu, 22 Jan 2015 00:47:26 -0800 (PST) X-Received: by 10.152.10.238 with SMTP id l14mr285748lab.68.1421916446567; Thu, 22 Jan 2015 00:47:26 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id 2si21527520lai.59.2015.01.22.00.47.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 00:47:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id p9so323078lbv.8 for ; Thu, 22 Jan 2015 00:47:26 -0800 (PST) X-Received: by 10.112.125.41 with SMTP id mn9mr298093lbb.80.1421916446413; Thu, 22 Jan 2015 00:47:26 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp187277lbb; Thu, 22 Jan 2015 00:47:25 -0800 (PST) X-Received: by 10.70.26.196 with SMTP id n4mr217964pdg.85.1421916444741; Thu, 22 Jan 2015 00:47:24 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hp6si11572323pbc.11.2015.01.22.00.47.23 for ; Thu, 22 Jan 2015 00:47:24 -0800 (PST) Received-SPF: none (google.com: linux-gpio-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577AbbAVIrK (ORCPT ); Thu, 22 Jan 2015 03:47:10 -0500 Received: from mail-lb0-f176.google.com ([209.85.217.176]:48801 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752033AbbAVIrI (ORCPT ); Thu, 22 Jan 2015 03:47:08 -0500 Received: by mail-lb0-f176.google.com with SMTP id z12so325766lbi.7 for ; Thu, 22 Jan 2015 00:47:07 -0800 (PST) X-Received: by 10.152.27.228 with SMTP id w4mr212279lag.75.1421916426981; Thu, 22 Jan 2015 00:47:06 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id aq4sm5540929lbc.46.2015.01.22.00.47.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 00:47:06 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij , Wei Chen Subject: [PATCH] gpio: sx150x: fixup OF support Date: Thu, 22 Jan 2015 09:47:01 +0100 Message-Id: <1421916421-11716-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-gpio@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Make OF conditional on CONFIG_OF_GPIO, rename and register the match table. Reported-by: Mike Krinkin Cc: Wei Chen Signed-off-by: Linus Walleij --- drivers/gpio/gpio-sx150x.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c index 88012e2b5b15..458d9d7952b8 100644 --- a/drivers/gpio/gpio-sx150x.c +++ b/drivers/gpio/gpio-sx150x.c @@ -152,12 +152,13 @@ static const struct i2c_device_id sx150x_id[] = { }; MODULE_DEVICE_TABLE(i2c, sx150x_id); -static const struct of_device_id sx150x_dt_id[] = { +static const struct of_device_id sx150x_of_match[] = { { .compatible = "semtech,sx1508q" }, { .compatible = "semtech,sx1509q" }, { .compatible = "semtech,sx1506q" }, {}, }; +MODULE_DEVICE_TABLE(of, sx150x_of_match); static s32 sx150x_i2c_write(struct i2c_client *client, u8 reg, u8 val) { @@ -484,8 +485,10 @@ static void sx150x_init_chip(struct sx150x_chip *chip, chip->gpio_chip.base = pdata->gpio_base; chip->gpio_chip.can_sleep = true; chip->gpio_chip.ngpio = chip->dev_cfg->ngpios; +#ifdef CONFIG_OF_GPIO chip->gpio_chip.of_node = client->dev.of_node; chip->gpio_chip.of_gpio_n_cells = 2; +#endif if (pdata->oscio_is_gpo) ++chip->gpio_chip.ngpio; @@ -681,7 +684,7 @@ static struct i2c_driver sx150x_driver = { .driver = { .name = "sx150x", .owner = THIS_MODULE, - .of_match_table = of_match_ptr(sx150x_dt_id), + .of_match_table = of_match_ptr(sx150x_of_match), }, .probe = sx150x_probe, .remove = sx150x_remove,