From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 511C4C43217 for ; Tue, 2 Nov 2021 16:47:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D7CE60F24 for ; Tue, 2 Nov 2021 16:47:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233758AbhKBQtt (ORCPT ); Tue, 2 Nov 2021 12:49:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57301 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231725AbhKBQto (ORCPT ); Tue, 2 Nov 2021 12:49:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635871628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OXCcgVDujHkdu74YmEm/6uZxSbK6QTtbfJnMu16uuZU=; b=hgaFsWGpl073kSM7zs0J6RIyNgrUoIZOtWxnxxV+pwq2kUlSeXihoak9vycHUtuIZayYpl 3z0RRwqlJMe8+lzBK+qFyLGcWUPAPLmWM8mmX4cjhdbGV1iL7Ew5gWNos08lw5wjqMtGuS hiq8B/1WE1hv4VIZK1lkvGELnlOwkXw= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-37-PlaI5KeEOta_NaDDU4k45g-1; Tue, 02 Nov 2021 12:11:30 -0400 X-MC-Unique: PlaI5KeEOta_NaDDU4k45g-1 Received: by mail-ed1-f72.google.com with SMTP id w12-20020aa7da4c000000b003e28acbf765so6833372eds.6 for ; Tue, 02 Nov 2021 09:11:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=OXCcgVDujHkdu74YmEm/6uZxSbK6QTtbfJnMu16uuZU=; b=N4ohmrrxxsI04aEZJilwjPOlCP9Gh9r5PIabV8280/IrtuATljftxyZRMBaP1bdQcG B6UJ2/DIRRjTZjy3xyDWtfQKEqPMmZbWicmvKKKPelCyVGLdLxZcbQZaWC9klGWlrwFU QhJBKw6tHBwB9dEyIUmQFT/LMEfIRgtiBvXjGwTD+Mb8vC63aQnThyBKviBACmF+Necn cAImknVCIXsKGDm6HkeWec1sEYWyXVFF/Xul8Bjp5jWRZyB2yWvZc9ZoF5JOa//5NQ4H RMFTgryXJKOXBx3lPVoHseZGlaPZ3JSOTdoOxu/+Go65LICGl0aBxLtF/CUEAzOJxbvU lsYw== X-Gm-Message-State: AOAM530MuEEU9bfX8ONLPVRjY/rFLioeuPl0F4PRBlFU72VKSTw+/sJy Hr3vuaBQuV6EXaxA2jdzqcdyKP/O98O3AjpB+Dxsrw4fYOSHnHU3pwQcQds5In8G6jLlIUZQA6i zRfQtw5thDtPaG3UrbPzhUPKX X-Received: by 2002:a17:906:ce2b:: with SMTP id sd11mr41196375ejb.357.1635869489659; Tue, 02 Nov 2021 09:11:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc7xvozzFCrT+ldZQZpz2qqh+5IJOeJ4jcizwG2L2dQLGetL43/Fnv4jvYRJN+ddJ55lpktA== X-Received: by 2002:a17:906:ce2b:: with SMTP id sd11mr41196329ejb.357.1635869489417; Tue, 02 Nov 2021 09:11:29 -0700 (PDT) Received: from ?IPV6:2001:1c00:c1e:bf00:1054:9d19:e0f0:8214? (2001-1c00-0c1e-bf00-1054-9d19-e0f0-8214.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:1054:9d19:e0f0:8214]) by smtp.gmail.com with ESMTPSA id j3sm8322037ejo.2.2021.11.02.09.11.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Nov 2021 09:11:28 -0700 (PDT) Message-ID: <69cc36ec-0674-2acb-6d23-4d7bc8c63fd9@redhat.com> Date: Tue, 2 Nov 2021 17:11:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v5 10/11] platform/x86: int3472: Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell Content-Language: en-US To: Andy Shevchenko Cc: "Rafael J . Wysocki" , Mark Gross , Andy Shevchenko , Wolfram Sang , Mika Westerberg , Daniel Scally , Laurent Pinchart , Mauro Carvalho Chehab , Liam Girdwood , Mark Brown , Michael Turquette , Stephen Boyd , Len Brown , ACPI Devel Maling List , Platform Driver , Linux Kernel Mailing List , linux-i2c , Sakari Ailus , Kate Hsuan , Linux Media Mailing List , linux-clk References: <20211102094907.31271-1-hdegoede@redhat.com> <20211102094907.31271-11-hdegoede@redhat.com> <1f4377bb-2902-05e9-95c7-ad924477b543@redhat.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 11/2/21 16:52, Andy Shevchenko wrote: > On Tue, Nov 2, 2021 at 4:59 PM Hans de Goede wrote: >> On 11/2/21 15:34, Andy Shevchenko wrote: >>> On Tue, Nov 2, 2021 at 11:50 AM Hans de Goede wrote: > > ... > >>>> + board_data = int3472_tps68470_get_board_data(dev_name(&client->dev)); >>>> + if (!board_data) { >>>> + dev_err(&client->dev, "No board-data found for this laptop/tablet model\n"); >>>> + return -ENODEV; >>> >>> It's fine to use dev_err_probe() for known error codes. >>> >>>> + } >>> >>> ... >>> >>>> + cells[1].platform_data = (void *)board_data->tps68470_regulator_pdata; >>> >>> Do we need casting? >> >> Yes, the cast casts away a "const", the const is correct >> since the data only ever gets read by the regulator driver, >> but platform_data pointers are normally not const, so it >> is either the cast, or loose the const on the definition >> of the struct to which board_data->tps68470_regulator_pdata >> points... >> >> So not good choice here really, only chosing between bad >> options and I picked the lets do the cast "least worse" >> option (at least to me). I'm open to changing this. > > Hmm... Okay, I was under the impression that MFD is using const for > that field... Nope, I just double-checked and it is a plain "void *" Regards, Hans