Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp446279lqo; Wed, 8 May 2024 05:01:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVAdcCR9lcwGwyvsyYeMxVATSwKs2Bck8tbKykTQVAgopOFHinKrunbraisGOTCJtJ5gLkKLQf2sC0X+ccAbkb+qRh+iPBsvoJElZ+G/Q== X-Google-Smtp-Source: AGHT+IH/UWReCj8PMrMJcuhgygGVQYprLDQQK7ipYVSuyoFYZiAvi2Q9b/R6Rd/FNv35h42Sv89M X-Received: by 2002:a62:e913:0:b0:6ed:2f52:9acd with SMTP id d2e1a72fcca58-6f49c294577mr2279473b3a.24.1715169700699; Wed, 08 May 2024 05:01:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715169700; cv=pass; d=google.com; s=arc-20160816; b=Ag8SQ3Xce0DVYaFix7L0BPgSucvBGt6xgiavDjjKH5CMNI8D6LYvItSxrJqKmb9UQE F6hsH2Jd8H1tviiG9nLeStB2eTvrzYU6ewGHTAZ5sQhQWwbJggnw4lw/RqlsZGed5OE6 2GFIySYTU5CRPpEWli8cpqYXPjjR0078XWmxMMrVeSLXrA1fHWKZcT//r7NwCbJOyANJ +taoGDUYtUpfaRYsaDkU87YJOBliSdRmB1yH9qVB7U+GDBvFA+wd3S7I/FQOJFphRi9p JpV7VTx4M4IiXY3l8e+snK0skBApbuBYNTq7dwWne8/f4Wf/ykLtwGHvecU7fo/3RUI4 AIlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kethK5xhy8AmFtSG/f98QJ6QII0o11D0NSb9krc7iT4=; fh=aFWGKdugIbyZlP5RRD2bxrwZhCsBfRwIuTbeRR6OlZg=; b=cRAlNez68fMQd6jD/+pb09tdyTMpWQrLDBRnZinyQLjKAhhpry53e5W+FtvbkIaLoa SFOhIXw1sh5PWFYx7OX/Xyilz3bPmVTp1wVJkS0FYIvfWt1OKxd3KnR5Ho5UNbRVlbD2 f0Qz08pniPTR18pivvaQV//SHO0ZVieIHJ6nolbkGwvScu7P3fSUlcStABTKmX80hdVJ fdIZ+l30voBV9lz57M4DIVLd0r7emEh9nt5pO0AXt/A4C5sPu8Jzff3WqbWDtLnbO49y wqMUBwX/v5iLrjnktMzcLzLDRHZxtfB8zXNBAP8/CsaUdFa2MJvxkFqtrSRXYd1zmlxj Tjdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZPEy+Je9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-173086-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j6-20020aa78dc6000000b006f455203de4si8988379pfr.30.2024.05.08.05.01.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 05:01:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173086-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZPEy+Je9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-173086-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8CDEAB24D98 for ; Wed, 8 May 2024 10:49:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6263D82480; Wed, 8 May 2024 10:48:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZPEy+Je9" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 252CC81726 for ; Wed, 8 May 2024 10:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715165336; cv=none; b=NslwbV2A1jhzSQkUrLrIwQkyYOa+aPp0W6BZ31hTVydULiYT4wZs4Cc6osedqdZKb/JApveDIj1SEB1GwCHJ6V6NtK5EkFpnrZwt8DSukvyDZyi/LXFZOKReFRiIjnpJgbcq3uC5j1oHV/UtjeP1nShDiUeh47SAYuX9YzHjyhw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715165336; c=relaxed/simple; bh=I7qb+olAYnL2mXPMtiZeYAJSJKv8HID4q3q4py1NbjE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=doQFwJkREcrWuBL9QQye9p97wLe1hVmfWtSP2SXvDT/Du4JqnLFiW43IVpB2icq0y2WYoTUt1l1qxZ3XQzN4spAfkwk1h8MbMX0gnzc5y6GKMV6UUCy98yQYJDppeAYLs5SqNkZLc+2Dc8WcjGTOvXIVLgPyjsFcm9SCz3UWo4c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZPEy+Je9; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715165336; x=1746701336; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I7qb+olAYnL2mXPMtiZeYAJSJKv8HID4q3q4py1NbjE=; b=ZPEy+Je9VJ0o+Sp4QrPr+Jh4fgMNunHp+ISd5jq8r4xNf/qmQX2x//l2 460gRFwRgkW1VZBuJuQ6Jk2QtC245HI/J6H8giRkGhwOYUXYqQ6c6NnDM kZsEyJO15ncyIjtbIxiEzOX+XlZ0jeJ8nrGwXlDFAIWb/He4JzSp9RJ6v m+ZvFXT+0fYFsO61MBO3S8UF4EcY8/HaYaAlTe44axqxcvUJLnAV3Vfpk CVhV4WtY79H2UOxy0tJAqDpD/n9A6dDdyy713qc4hNsGN/5aCyJFBTFJu h7jY1ZvnuHfcfd1yTRKadpmIhmwngp2yBGwWZaWO7jKMQwVTz3OdYKGcj g==; X-CSE-ConnectionGUID: KhmsD4DWRgKty93tvq+eEA== X-CSE-MsgGUID: EOhr/SeVQvuPDnL/Fe/pLw== X-IronPort-AV: E=McAfee;i="6600,9927,11066"; a="21615955" X-IronPort-AV: E=Sophos;i="6.08,145,1712646000"; d="scan'208";a="21615955" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2024 03:48:53 -0700 X-CSE-ConnectionGUID: guuC1Q2qT5+siDVj2jtGSw== X-CSE-MsgGUID: FeCPCp61QwmlWAoi74Kzxw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,145,1712646000"; d="scan'208";a="59705174" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 08 May 2024 03:48:52 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 27CB986; Wed, 08 May 2024 13:48:50 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Lee Jones , Linus Walleij Subject: [PATCH v1 1/2] mfd: lm3533: Hide legacy platform data in the driver Date: Wed, 8 May 2024 13:46:48 +0300 Message-ID: <20240508104848.846580-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240508104848.846580-1-andriy.shevchenko@linux.intel.com> References: <20240508104848.846580-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit First of all, there is no user for the platform data in the kernel. Second, it needs a lot of updates to follow the modern standards of the kernel, including proper Device Tree bindings and device property handling. For now, just hide the legacy platform data in the driver's code. Signed-off-by: Andy Shevchenko --- drivers/mfd/lm3533-core.c | 23 ++++++++++++++++++----- include/linux/mfd/lm3533.h | 15 --------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c index c211183cecb2..515a6c3b3244 100644 --- a/drivers/mfd/lm3533-core.c +++ b/drivers/mfd/lm3533-core.c @@ -21,6 +21,20 @@ #include +struct lm3533_platform_data { + int gpio_hwen; + + enum lm3533_boost_ovp boost_ovp; + enum lm3533_boost_freq boost_freq; + + struct lm3533_als_platform_data *als; + + struct lm3533_bl_platform_data *backlights; + int num_backlights; + + struct lm3533_led_platform_data *leds; + int num_leds; +}; #define LM3533_BOOST_OVP_MASK 0x06 #define LM3533_BOOST_OVP_SHIFT 1 @@ -473,15 +487,14 @@ static int lm3533_device_setup(struct lm3533 *lm3533, static int lm3533_device_init(struct lm3533 *lm3533) { - struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev); + struct lm3533_platform_data *pdata; int ret; dev_dbg(lm3533->dev, "%s\n", __func__); - if (!pdata) { - dev_err(lm3533->dev, "no platform data\n"); - return -EINVAL; - } + pdata = devm_kzalloc(lm3533->dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; lm3533->gpio_hwen = pdata->gpio_hwen; diff --git a/include/linux/mfd/lm3533.h b/include/linux/mfd/lm3533.h index 77092f6363ad..ce42f0737768 100644 --- a/include/linux/mfd/lm3533.h +++ b/include/linux/mfd/lm3533.h @@ -68,21 +68,6 @@ enum lm3533_boost_ovp { LM3533_BOOST_OVP_40V, }; -struct lm3533_platform_data { - int gpio_hwen; - - enum lm3533_boost_ovp boost_ovp; - enum lm3533_boost_freq boost_freq; - - struct lm3533_als_platform_data *als; - - struct lm3533_bl_platform_data *backlights; - int num_backlights; - - struct lm3533_led_platform_data *leds; - int num_leds; -}; - extern int lm3533_ctrlbank_enable(struct lm3533_ctrlbank *cb); extern int lm3533_ctrlbank_disable(struct lm3533_ctrlbank *cb); -- 2.43.0.rc1.1336.g36b5255a03ac