]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: tas2781: Switch to use %ptTsr
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 6 Feb 2025 19:25:15 +0000 (21:25 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 6 Feb 2025 20:45:56 +0000 (20:45 +0000)
Use %ptTsr instead of open-coded variant to print contents of time64_t type
in human readable form.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250206192537.1133763-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/tas2781.h
sound/pci/hda/tas2781-spi.h
sound/pci/hda/tas2781_hda_i2c.c
sound/pci/hda/tas2781_hda_spi.c

index 72d2060904f6a94c4d5cc34a6543808bbd2ffe0a..0f1e585635bb098d47f085b466fda02fa28a799a 100644 (file)
@@ -161,7 +161,6 @@ struct tasdevice_priv {
        struct mutex codec_lock;
        struct regmap *regmap;
        struct device *dev;
-       struct tm tm;
 
        enum device_catlog_id catlog_id;
        unsigned char cal_binaryname[TASDEVICE_MAX_CHANNELS][64];
index ecfc3c8bb821474c8f20d7dab01b009f8c66ae62..7a0faceeb675b148e6782d4026dc81d84d1ab027 100644 (file)
@@ -88,7 +88,6 @@ struct tasdevice_priv {
        struct mutex codec_lock;
        struct regmap *regmap;
        struct device *dev;
-       struct tm tm;
 
        unsigned char crc8_lkp_tbl[CRC8_TABLE_SIZE];
        unsigned char coef_binaryname[64];
index 0e42b87dadb8af7995123b6b83d4092d1d87dc6f..be9a90f643ebb3079ca23a9531bd5c901cf5a8c8 100644 (file)
@@ -594,7 +594,6 @@ static int tas2781_save_calibration(struct tasdevice_priv *tas_priv)
        efi_guid_t efi_guid = EFI_GUID(0x02f9af02, 0x7734, 0x4233, 0xb4, 0x3d,
                0x93, 0xfe, 0x5a, 0xa3, 0x5d, 0xb3);
        static efi_char16_t efi_name[] = L"CALI_DATA";
-       struct tm *tm = &tas_priv->tm;
        unsigned int attr, crc;
        unsigned int *tmp_val;
        efi_status_t status;
@@ -629,10 +628,9 @@ static int tas2781_save_calibration(struct tasdevice_priv *tas_priv)
                crc, tmp_val[21]);
 
        if (crc == tmp_val[21]) {
-               time64_to_tm(tmp_val[20], 0, tm);
-               dev_dbg(tas_priv->dev, "%4ld-%2d-%2d, %2d:%2d:%2d\n",
-                       tm->tm_year, tm->tm_mon, tm->tm_mday,
-                       tm->tm_hour, tm->tm_min, tm->tm_sec);
+               time64_t seconds = tmp_val[20];
+
+               dev_dbg(tas_priv->dev, "%ptTsr\n", &seconds);
                tasdevice_apply_calibration(tas_priv);
        } else
                tas_priv->cali_data.total_sz = 0;
index a42fa990e7b9e7c956140255b5a1a8525ce0c84b..d91b19602485aab345406661a444bc31e56bae91 100644 (file)
@@ -802,7 +802,6 @@ static int tas2781_save_calibration(struct tasdevice_priv *tas_priv)
        static efi_char16_t efi_name[] = TASDEVICE_CALIBRATION_DATA_NAME;
        unsigned char data[TASDEVICE_CALIBRATION_DATA_SIZE], *buf;
        unsigned int attr, crc, offset, *tmp_val;
-       struct tm *tm = &tas_priv->tm;
        unsigned long total_sz = 0;
        efi_status_t status;
 
@@ -849,7 +848,6 @@ static int tas2781_save_calibration(struct tasdevice_priv *tas_priv)
                if (crc != tmp_val[3 + tmp_val[1] * 6])
                        return 0;
 
-               time64_to_tm(tmp_val[2], 0, tm);
                for (int j = 0; j < tmp_val[1]; j++) {
                        offset = j * 6 + 3;
                        if (tmp_val[offset] == tas_priv->index) {
@@ -882,7 +880,6 @@ static int tas2781_save_calibration(struct tasdevice_priv *tas_priv)
                 */
                crc = crc32(~0, data, 84) ^ ~0;
                if (crc == tmp_val[21]) {
-                       time64_to_tm(tmp_val[20], 0, tm);
                        for (int i = 0; i < CALIB_MAX; i++)
                                tas_priv->cali_data[i] =
                                        tmp_val[tas_priv->index * 5 + i];