Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4780584pxb; Tue, 2 Nov 2021 15:57:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUK6tkIRMxYNPubjZzY7yw4jCYw2L2EE+QWNgVPioxSP5WKi2Oi/TLS0q9BWUuFtd2GMTO X-Received: by 2002:aa7:d556:: with SMTP id u22mr54797465edr.226.1635893870363; Tue, 02 Nov 2021 15:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635893870; cv=none; d=google.com; s=arc-20160816; b=nOu5HsaVCY27+njmxqjU0N+RAHEODjW4osqNN87uV1h0NNfSPXl0xwZElFJCMPhgDP E62zIb9FPCm1853dF9yfHZBXOyGL0+uksgPfuoRyhkjrXSy17TUW0dU1FHNHaWebc3JD QirobmBE6E2hqWrHLvogx4CFlB+CiMRmA0W8grXXKT8GQhurdsLYPa6DCYwEfUU37Pu+ BEdNb+XC6hsS0mdEnnEiXTFzHSogHIf6aRB5atwnPCjzr3uPy7lO/WCc0tmsiFZf9D0c +C7ybIaXmb69cpaEnS/QPTaf4JD79UFfCS11futBPkWe9bqSZVkvEQZmjQwJtTkIKwr/ onDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Fy+8FMWEkbUGkl/aK9LgOKbIU9Rw5ScB9WxKjqG0/jw=; b=Lvh7zi+9iIrdAh6JWkj2hYOhgjPZk5VDQ1E3puTVVrTUvVDZ9YBIx3w5qE2W1dUpaW Y+Awoou6KZfmF7MW6iKgnWDbIQp0xGKUkIqRDilaIUF6F7YincJGgD9KA4MCPvcVh6Yu xlsRI8ALf9CCpr5ZQ++Pw3o7Cooqf5/U+CfzeyIkrP4AzNgUK2atq1XeCqbNN7BmE8To 0pvMkWjxof3stoz+aJ1TXn/owKYuwNWk2R6467r/59+xdiyPG6/1O7YvcZwSxP2vHYDO YYGAKoTTsQNLOj8i3TBRb9jtOkUFGgHXQpZNUQ9vxL6xdZoDwJ157nlfs7cHTpE/gncy W3Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PwzpJ39+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd11si719037ejc.222.2021.11.02.15.57.25; Tue, 02 Nov 2021 15:57:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PwzpJ39+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230382AbhKBW6O (ORCPT + 99 others); Tue, 2 Nov 2021 18:58:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34495 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbhKBW6K (ORCPT ); Tue, 2 Nov 2021 18:58:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635893733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Fy+8FMWEkbUGkl/aK9LgOKbIU9Rw5ScB9WxKjqG0/jw=; b=PwzpJ39+aAizSR3JrBzjVOUmcDZi6QtI1aSW+rzvqKMgnHXwEUKwNEcrU6jVyOYfyASsVf QkJ5RiZfUSVU7TVcW62tIa9OBYdWavnIk8cFubqm1Ha/CYhgDO6koSCgNiEKNXhP5gNRwX WSuI/yCpZHo4xpvU8ii5nvOXV4r0NQU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-183-kevJjX-iMu-TQDc1PN7qbA-1; Tue, 02 Nov 2021 18:55:30 -0400 X-MC-Unique: kevJjX-iMu-TQDc1PN7qbA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD34BBBEE0; Tue, 2 Nov 2021 22:55:28 +0000 (UTC) Received: from x1.localdomain (unknown [10.39.192.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE7AA57CB9; Tue, 2 Nov 2021 22:55:05 +0000 (UTC) From: Hans de Goede To: Lee Jones , Daniel Thompson , Jingoo Han Cc: Hans de Goede , Tsuchiya Yuto , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] backlight: lp855x: Move device_config setting out of lp855x_configure() Date: Tue, 2 Nov 2021 23:55:02 +0100 Message-Id: <20211102225504.18920-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the setting of the lp->cfg pointer to the chip specific lp855x_device_config struct from lp855x_configure() to lp855x_probe(), before calling lp855x_parse_dt(). This is a preperation patch for adding ACPI enumeration support. Reviewed-by: Daniel Thompson Signed-off-by: Hans de Goede --- drivers/video/backlight/lp855x_bl.c | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index e94932c69f54..808ff00b2003 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c @@ -170,22 +170,6 @@ static int lp855x_configure(struct lp855x *lp) int i, ret; struct lp855x_platform_data *pd = lp->pdata; - switch (lp->chip_id) { - case LP8550: - case LP8551: - case LP8552: - case LP8553: - case LP8556: - lp->cfg = &lp855x_dev_cfg; - break; - case LP8555: - case LP8557: - lp->cfg = &lp8557_dev_cfg; - break; - default: - return -EINVAL; - } - if (lp->cfg->pre_init_device) { ret = lp->cfg->pre_init_device(lp); if (ret) { @@ -413,6 +397,22 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id) lp->chip_id = id->driver_data; lp->pdata = dev_get_platdata(&cl->dev); + switch (lp->chip_id) { + case LP8550: + case LP8551: + case LP8552: + case LP8553: + case LP8556: + lp->cfg = &lp855x_dev_cfg; + break; + case LP8555: + case LP8557: + lp->cfg = &lp8557_dev_cfg; + break; + default: + return -EINVAL; + } + if (!lp->pdata) { ret = lp855x_parse_dt(lp); if (ret < 0) -- 2.31.1