From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bjorn Andersson Subject: Re: [PATCH 2/5] drm/i2c: adv7511: Initial support for adv7533 Date: Mon, 27 Jul 2015 20:27:37 -0700 Message-ID: <20150728032737.GN4753@usrtlx11787.corpusers.net> References: <1437977819-24199-1-git-send-email-architt@codeaurora.org> <1437977819-24199-3-git-send-email-architt@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Received: from seldrel01.sonyericsson.com ([37.139.156.2]:8997 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753934AbbG1D1s (ORCPT ); Mon, 27 Jul 2015 23:27:48 -0400 Content-Disposition: inline In-Reply-To: <1437977819-24199-3-git-send-email-architt@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Archit Taneja Cc: dri-devel@lists.freedesktop.org, lars@metafoo.de, linux-arm-msm@vger.kernel.org, andy.green@linaro.org, srinivas.kandagatla@linaro.org, laurent.pinchart@ideasonboard.com On Sun 26 Jul 23:16 PDT 2015, Archit Taneja wrote: > From: Lars-Peter Clausen > [..] > diff --git a/drivers/gpu/drm/i2c/adv7511.c b/drivers/gpu/drm/i2c/adv7511.c [..] > > +static const struct of_device_id adv7511_of_ids[] = { > + { .compatible = "adi,adv7511", .data = (void *) ADV7511 }, > + { .compatible = "adi,adv7511w", .data = (void *) ADV7511 }, > + { .compatible = "adi,adv7513", .data = (void *) ADV7511 }, > + { .compatible = "adi,adv7533", .data = (void *) ADV7533 }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, adv7511_of_ids); Please leave this at the bottom. > + > static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) > { > struct adv7511_link_config link_config; > @@ -871,9 +938,22 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) > adv7511->powered = false; > adv7511->status = connector_status_disconnected; > > - ret = adv7511_parse_dt(dev->of_node, &link_config); > - if (ret) > - return ret; > + if (dev->of_node) { > + const struct of_device_id *of_id; > + > + of_id = of_match_node(adv7511_of_ids, dev->of_node); If you use of_device_get_match_data() instead you don't need to move the of_device_id table. > + adv7511->type = (enum adv7511_type) of_id->data; > + } else { > + adv7511->type = id->driver_data; > + } > + [..] > > static const struct i2c_device_id adv7511_i2c_ids[] = { > - { "adv7511", 0 }, > - { "adv7511w", 0 }, > - { "adv7513", 0 }, > + { "adv7511", ADV7511 }, > + { "adv7511w", ADV7511 }, > + { "adv7513", ADV7511 }, > + { "adv7533", ADV7533 }, > { } > }; > MODULE_DEVICE_TABLE(i2c, adv7511_i2c_ids); > > -static const struct of_device_id adv7511_of_ids[] = { > - { .compatible = "adi,adv7511", }, > - { .compatible = "adi,adv7511w", }, > - { .compatible = "adi,adv7513", }, > - { } > -}; > -MODULE_DEVICE_TABLE(of, adv7511_of_ids); > - Regards, Bjorn