Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3336939pxb; Mon, 1 Nov 2021 12:00:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy1YIzy1yV4vrhIKUd8j5V3U1oju+dpHbF1qZovBPX3Y/TcP/50JRHu9ylvWofemQSv61X X-Received: by 2002:a17:906:6dd8:: with SMTP id j24mr3569591ejt.167.1635793209092; Mon, 01 Nov 2021 12:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635793209; cv=none; d=google.com; s=arc-20160816; b=Y1tDolQNbehEc4oJomfktd3Ea/S70UyMJByNyIiTQVwhV95eqUCR1uAR7xpAJrDKG+ BpPAAAudXQbT3ybASHThklDoAAPQInk6bzO6jgApLTcGNscgd9OAA8OU/uWOpNk1gwbr JiCDFjE24r06btlDOQJPz7/kwYwTrDXzHcDRmcCBWW1KdUFbcb32tAIvEYEn5rvRkWC+ yEmSHFHwtf95377Mfejc5YcZWInrrFZF1NYlysdFarDJp8QNdNY4FgwYbQ92jwHZfHkd r8CRagkhqiaJZa5mtElQ6AGPiVv9LuLmc1vB1Fk7FyuCX3E8HF1KDADCD6fQV0G5q1NR GdPA== 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=gZzdkJekBWG4x4xkvb6CthYR9L71Zxbnl6IAJZMNVVM=; b=yFOu/4UskZUUeKXHxcaK8uvFi8OwZwhYAeErWbwldtAr0zMTqPmbLq5nCZIT3SqJfU F1NlciRS3u+or791y/1yPsTbK1bsyfivlxi0j+73YOjUBz3LxbHspfuoxDRKrar9Vr0D VQVkMr0ZVp6DFIQpYI03UDAUp0V+JiB53GnBuo1z/yi9zdCWPxqbcy9/R89JBzxz3Ktj 8853oMtaOptHNMRYzwuxXkNFVDLdmHpSHa67OWL4KYHoVgFvF9YjaI4E/8kTcc1Ifts/ vtQBV31s7+h3Jgz4tUDKJIJ2DG6HxDdIPv0sRhC5JXk4Mcvhr5p4gPzs0gXvxUTqJiMz xGxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HyLeVtb3; 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 q17si25610071edd.291.2021.11.01.11.59.45; Mon, 01 Nov 2021 12:00:09 -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=HyLeVtb3; 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 S232079AbhKAS6L (ORCPT + 99 others); Mon, 1 Nov 2021 14:58:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30653 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231205AbhKAS6F (ORCPT ); Mon, 1 Nov 2021 14:58:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635792924; 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=gZzdkJekBWG4x4xkvb6CthYR9L71Zxbnl6IAJZMNVVM=; b=HyLeVtb34EW+AONdXq7iNu0XQtXn83tqN5E+ZCiUXPOQK4lr7GNz915dpzCPqzDuC8znyK 0+FBQjqZKa+5czcPHq3oIVYlEXzpcbTbB1+RHY82LZO5FeZefULnZMSHi3y8xBVAaYz1sy /CH6KYNQG2YM7F1kjwTSDb/x3vQq6is= 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-552-VzgEnrQxMWWt2qRthEsR_w-1; Mon, 01 Nov 2021 14:55:21 -0400 X-MC-Unique: VzgEnrQxMWWt2qRthEsR_w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 26F57100C661; Mon, 1 Nov 2021 18:55:20 +0000 (UTC) Received: from x1.localdomain (unknown [10.39.192.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id E273160C17; Mon, 1 Nov 2021 18:55:18 +0000 (UTC) From: Hans de Goede To: Lee Jones , Daniel Thompson , Jingoo Han Cc: Hans de Goede , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] backlight: lp855x: Move device_config setting out of lp855x_configure() Date: Mon, 1 Nov 2021 19:55:15 +0100 Message-Id: <20211101185518.306728-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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. 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