EEPROM put / get - Why isn't this working?

Hey guys,

I've been trying to store a long into EEPROM like this for an hour now, but can't get it to work...

long mileage;
// Mileage
void set_Mileage(long val) {
  mileage = val;
  EEPROM.put(10, mileage); //write unsigned long number u want
}
long get_Mileage() {
  return EEPROM.get(10, mileage);
}

Anyone who can help me out?

Thanks!

Obviously the error is in the code you are hiding.

#include <EEPROM.h>

long mileage;

void set_Mileage(long val) {
  mileage = val;
  EEPROM.put(10, mileage);
}
long get_Mileage() {
  return EEPROM.get(10, mileage);
}

void setup() {
  Serial.begin(250000);
  Serial.print(F("mileage start  "));
  Serial.println(mileage);
  set_Mileage(123456);
  Serial.print(F("mileage store  "));
  Serial.println(mileage);
  mileage = 654321;
  Serial.print(F("mileage change "));
  Serial.println(mileage);
  get_Mileage();
  Serial.print(F("mileage reload "));
  Serial.println(mileage);
}
void loop() {}
mileage start  0
mileage store  123456
mileage change 654321
mileage reload 123456

You are right, very stupid of me.
The Mileage is being parsed through another function where the variable was still an int...
Sorry for wasting your time!